X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Ffreevxfs%2Fvxfs_immed.c;h=4e25f3fbed86c71d7a92722ea00bfbb82711860f;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=be243053a7c1b24737493a34de8ae8f4bb888daa;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/fs/freevxfs/vxfs_immed.c b/fs/freevxfs/vxfs_immed.c index be243053a..4e25f3fbe 100644 --- a/fs/freevxfs/vxfs_immed.c +++ b/fs/freevxfs/vxfs_immed.c @@ -32,13 +32,13 @@ */ #include #include +#include #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);