From: Josef 'Jeff' Sipek Date: Thu, 19 Jul 2007 08:48:21 +0000 (-0700) Subject: nfsctl: use vfs_path_lookup X-Git-Tag: v2.6.23-rc1~414 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16b6287a5286e872abece4f42a6eb5899157a836;p=linux-2.6 nfsctl: use vfs_path_lookup use vfs_path_lookup instead of open-coding the necessary functionality. Signed-off-by: Josef 'Jeff' Sipek Acked-by: NeilBrown Cc: Al Viro Acked-by: Christoph Hellwig Cc: Trond Myklebust Cc: Michael Halcrow Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/nfsctl.c b/fs/nfsctl.c index c043136a82..51f1b31acb 100644 --- a/fs/nfsctl.c +++ b/fs/nfsctl.c @@ -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);