nfsctl: use vfs_path_lookup

use vfs_path_lookup instead of open-coding the necessary functionality.

Signed-off-by: Josef 'Jeff' Sipek <[email protected]>
Acked-by: NeilBrown <[email protected]>
Cc: Al Viro <[email protected]>
Acked-by: Christoph Hellwig <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Michael Halcrow <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Josef 'Jeff' Sipek 2007-07-19 01:48:21 -07:00 • committed by Linus Torvalds
commit 16b6287a52

View file

@ -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);