Skip to content

Commit

Permalink
nfsctl: use vfs_path_lookup
Browse files Browse the repository at this point in the history
use vfs_path_lookup instead of open-coding the necessary functionality.

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Acked-by: NeilBrown <neilb@suse.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Christoph Hellwig <hch@lst.de>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Josef 'Jeff' Sipek authored and Linus Torvalds committed Jul 19, 2007
1 parent 4ac4efc commit 16b6287
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions fs/nfsctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,15 @@
static struct file *do_open(char *name, int flags)
{
struct nameidata nd;
struct vfsmount *mnt;
int error;

nd.mnt = do_kern_mount("nfsd", 0, "nfsd", NULL);
mnt = do_kern_mount("nfsd", 0, "nfsd", NULL);
if (IS_ERR(mnt))
return (struct file *)mnt;

if (IS_ERR(nd.mnt))
return (struct file *)nd.mnt;

nd.dentry = dget(nd.mnt->mnt_root);
nd.last_type = LAST_ROOT;
nd.flags = 0;
nd.depth = 0;

error = path_walk(name, &nd);
error = vfs_path_lookup(mnt->mnt_root, mnt, name, 0, &nd);
mntput(mnt); /* drop do_kern_mount reference */
if (error)
return ERR_PTR(error);

Expand Down

0 comments on commit 16b6287

Please sign in to comment.