aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfsctl.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/fs/nfsctl.c b/fs/nfsctl.c
index c043136a82ca..51f1b31acbf6 100644
--- a/fs/nfsctl.c
+++ b/fs/nfsctl.c
@@ -23,19 +23,15 @@
23static struct file *do_open(char *name, int flags) 23static struct file *do_open(char *name, int flags)
24{ 24{
25 struct nameidata nd; 25 struct nameidata nd;
26 struct vfsmount *mnt;
26 int error; 27 int error;
27 28
28 nd.mnt = do_kern_mount("nfsd", 0, "nfsd", NULL); 29 mnt = do_kern_mount("nfsd", 0, "nfsd", NULL);
30 if (IS_ERR(mnt))
31 return (struct file *)mnt;
29 32
30 if (IS_ERR(nd.mnt)) 33 error = vfs_path_lookup(mnt->mnt_root, mnt, name, 0, &nd);
31 return (struct file *)nd.mnt; 34 mntput(mnt); /* drop do_kern_mount reference */
32
33 nd.dentry = dget(nd.mnt->mnt_root);
34 nd.last_type = LAST_ROOT;
35 nd.flags = 0;
36 nd.depth = 0;
37
38 error = path_walk(name, &nd);
39 if (error) 35 if (error)
40 return ERR_PTR(error); 36 return ERR_PTR(error);
41 37