Commit 4ac4efc1 authored by Josef 'Jeff' Sipek's avatar Josef 'Jeff' Sipek Committed by Linus Torvalds

sunrpc: use vfs_path_lookup

use vfs_path_lookup instead of open-coding the necessary functionality.
Signed-off-by: default avatarJosef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Acked-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: default avatarChristoph Hellwig <hch@lst.de>
Cc: Neil Brown <neilb@suse.de>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 16f18200
...@@ -460,21 +460,19 @@ static struct dentry_operations rpc_dentry_operations = { ...@@ -460,21 +460,19 @@ static struct dentry_operations rpc_dentry_operations = {
static int static int
rpc_lookup_parent(char *path, struct nameidata *nd) rpc_lookup_parent(char *path, struct nameidata *nd)
{ {
struct vfsmount *mnt;
if (path[0] == '\0') if (path[0] == '\0')
return -ENOENT; return -ENOENT;
nd->mnt = rpc_get_mount();
if (IS_ERR(nd->mnt)) { mnt = rpc_get_mount();
if (IS_ERR(mnt)) {
printk(KERN_WARNING "%s: %s failed to mount " printk(KERN_WARNING "%s: %s failed to mount "
"pseudofilesystem \n", __FILE__, __FUNCTION__); "pseudofilesystem \n", __FILE__, __FUNCTION__);
return PTR_ERR(nd->mnt); return PTR_ERR(mnt);
} }
mntget(nd->mnt);
nd->dentry = dget(rpc_mount->mnt_root);
nd->last_type = LAST_ROOT;
nd->flags = LOOKUP_PARENT;
nd->depth = 0;
if (path_walk(path, nd)) { if (vfs_path_lookup(mnt->mnt_root, mnt, path, LOOKUP_PARENT, nd)) {
printk(KERN_WARNING "%s: %s failed to find path %s\n", printk(KERN_WARNING "%s: %s failed to find path %s\n",
__FILE__, __FUNCTION__, path); __FILE__, __FUNCTION__, path);
rpc_put_mount(); rpc_put_mount();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment