*/
#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 *);
* 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,
};
.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
* 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;
}
/**
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);