diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-06-27 17:00:37 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-20 01:44:14 -0400 |
commit | e0a0124936171af6156b80fe8ac8799f039e767f (patch) | |
tree | 5eed31f5b5dbf43f9a4d0e14fb4f9e1f9bcfd6d0 /fs/nfs/super.c | |
parent | ed75e95de574c99575e5f3e1d9ca59ea8c12a9cb (diff) |
switch vfs_path_lookup() to struct path
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r-- | fs/nfs/super.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index ce40e5c568ba..b961ceac66b4 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -2773,16 +2773,12 @@ static void nfs_referral_loop_unprotect(void) | |||
2773 | static struct dentry *nfs_follow_remote_path(struct vfsmount *root_mnt, | 2773 | static struct dentry *nfs_follow_remote_path(struct vfsmount *root_mnt, |
2774 | const char *export_path) | 2774 | const char *export_path) |
2775 | { | 2775 | { |
2776 | struct nameidata *nd = NULL; | ||
2777 | struct mnt_namespace *ns_private; | 2776 | struct mnt_namespace *ns_private; |
2778 | struct super_block *s; | 2777 | struct super_block *s; |
2779 | struct dentry *dentry; | 2778 | struct dentry *dentry; |
2779 | struct path path; | ||
2780 | int ret; | 2780 | int ret; |
2781 | 2781 | ||
2782 | nd = kmalloc(sizeof(*nd), GFP_KERNEL); | ||
2783 | if (nd == NULL) | ||
2784 | return ERR_PTR(-ENOMEM); | ||
2785 | |||
2786 | ns_private = create_mnt_ns(root_mnt); | 2782 | ns_private = create_mnt_ns(root_mnt); |
2787 | ret = PTR_ERR(ns_private); | 2783 | ret = PTR_ERR(ns_private); |
2788 | if (IS_ERR(ns_private)) | 2784 | if (IS_ERR(ns_private)) |
@@ -2793,7 +2789,7 @@ static struct dentry *nfs_follow_remote_path(struct vfsmount *root_mnt, | |||
2793 | goto out_put_mnt_ns; | 2789 | goto out_put_mnt_ns; |
2794 | 2790 | ||
2795 | ret = vfs_path_lookup(root_mnt->mnt_root, root_mnt, | 2791 | ret = vfs_path_lookup(root_mnt->mnt_root, root_mnt, |
2796 | export_path, LOOKUP_FOLLOW, nd); | 2792 | export_path, LOOKUP_FOLLOW, &path); |
2797 | 2793 | ||
2798 | nfs_referral_loop_unprotect(); | 2794 | nfs_referral_loop_unprotect(); |
2799 | put_mnt_ns(ns_private); | 2795 | put_mnt_ns(ns_private); |
@@ -2801,12 +2797,11 @@ static struct dentry *nfs_follow_remote_path(struct vfsmount *root_mnt, | |||
2801 | if (ret != 0) | 2797 | if (ret != 0) |
2802 | goto out_err; | 2798 | goto out_err; |
2803 | 2799 | ||
2804 | s = nd->path.mnt->mnt_sb; | 2800 | s = path.mnt->mnt_sb; |
2805 | atomic_inc(&s->s_active); | 2801 | atomic_inc(&s->s_active); |
2806 | dentry = dget(nd->path.dentry); | 2802 | dentry = dget(path.dentry); |
2807 | 2803 | ||
2808 | path_put(&nd->path); | 2804 | path_put(&path); |
2809 | kfree(nd); | ||
2810 | down_write(&s->s_umount); | 2805 | down_write(&s->s_umount); |
2811 | return dentry; | 2806 | return dentry; |
2812 | out_put_mnt_ns: | 2807 | out_put_mnt_ns: |
@@ -2814,7 +2809,6 @@ out_put_mnt_ns: | |||
2814 | out_mntput: | 2809 | out_mntput: |
2815 | mntput(root_mnt); | 2810 | mntput(root_mnt); |
2816 | out_err: | 2811 | out_err: |
2817 | kfree(nd); | ||
2818 | return ERR_PTR(ret); | 2812 | return ERR_PTR(ret); |
2819 | } | 2813 | } |
2820 | 2814 | ||