fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / fs / freevxfs / vxfs_immed.c
index be24305..4e25f3f 100644 (file)
  */
 #include <linux/fs.h>
 #include <linux/pagemap.h>
+#include <linux/namei.h>
 
 #include "vxfs.h"
 #include "vxfs_inode.h"
 
 
-static int     vxfs_immed_readlink(struct dentry *, char __user *, int);
-static int     vxfs_immed_follow_link(struct dentry *, struct nameidata *);
+static void *  vxfs_immed_follow_link(struct dentry *, struct nameidata *);
 
 static int     vxfs_immed_readpage(struct file *, struct page *);
 
@@ -49,39 +49,17 @@ static int  vxfs_immed_readpage(struct file *, struct page *);
  * but do all work directly on the inode.
  */
 struct inode_operations vxfs_immed_symlink_iops = {
-       .readlink =             vxfs_immed_readlink,
+       .readlink =             generic_readlink,
        .follow_link =          vxfs_immed_follow_link,
 };
 
 /*
  * Adress space operations for immed files and directories.
  */
-struct address_space_operations vxfs_immed_aops = {
+const struct address_space_operations vxfs_immed_aops = {
        .readpage =             vxfs_immed_readpage,
 };
 
-
-/**
- * vxfs_immed_readlink - read immed symlink
- * @dp:                dentry for the link
- * @bp:                output buffer
- * @buflen:    length of @bp
- *
- * Description:
- *   vxfs_immed_readlink calls vfs_readlink to read the link
- *   described by @dp into userspace.
- *
- * Returns:
- *   Number of bytes successfully copied to userspace.
- */
-static int
-vxfs_immed_readlink(struct dentry *dp, char __user *bp, int buflen)
-{
-       struct vxfs_inode_info          *vip = VXFS_INO(dp->d_inode);
-
-       return (vfs_readlink(dp, bp, buflen, vip->vii_immed.vi_immed));
-}
-
 /**
  * vxfs_immed_follow_link - follow immed symlink
  * @dp:                dentry for the link
@@ -94,12 +72,12 @@ vxfs_immed_readlink(struct dentry *dp, char __user *bp, int buflen)
  * Returns:
  *   Zero on success, else a negative error code.
  */
-static int
+static void *
 vxfs_immed_follow_link(struct dentry *dp, struct nameidata *np)
 {
        struct vxfs_inode_info          *vip = VXFS_INO(dp->d_inode);
-
-       return (vfs_follow_link(np, vip->vii_immed.vi_immed));
+       nd_set_link(np, vip->vii_immed.vi_immed);
+       return NULL;
 }
 
 /**
@@ -121,8 +99,8 @@ static int
 vxfs_immed_readpage(struct file *fp, struct page *pp)
 {
        struct vxfs_inode_info  *vip = VXFS_INO(pp->mapping->host);
-       u_int64_t               offset = pp->index << PAGE_CACHE_SHIFT;
-       caddr_t                 kaddr;
+       u_int64_t       offset = (u_int64_t)pp->index << PAGE_CACHE_SHIFT;
+       caddr_t         kaddr;
 
        kaddr = kmap(pp);
        memcpy(kaddr, vip->vii_immed.vi_immed + offset, PAGE_CACHE_SIZE);