diff options
author | Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu> | 2007-07-19 04:48:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 13:04:45 -0400 |
commit | 4ac4efc1f5575a268417f80ef4059aee383f8331 (patch) | |
tree | 46b5c73e424dbbab2d4feed1c42357305213d1c7 /net/sunrpc/rpc_pipe.c | |
parent | 16f1820028d660d9da9c03b2ae7e98253c11795b (diff) |
sunrpc: use vfs_path_lookup
use vfs_path_lookup instead of open-coding the necessary functionality.
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Christoph Hellwig <hch@lst.de>
Cc: Neil Brown <neilb@suse.de>
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>
Diffstat (limited to 'net/sunrpc/rpc_pipe.c')
-rw-r--r-- | net/sunrpc/rpc_pipe.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index e787b6a43eee..5b2b6fb244f2 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c | |||
@@ -460,21 +460,19 @@ static struct dentry_operations rpc_dentry_operations = { | |||
460 | static int | 460 | static int |
461 | rpc_lookup_parent(char *path, struct nameidata *nd) | 461 | rpc_lookup_parent(char *path, struct nameidata *nd) |
462 | { | 462 | { |
463 | struct vfsmount *mnt; | ||
464 | |||
463 | if (path[0] == '\0') | 465 | if (path[0] == '\0') |
464 | return -ENOENT; | 466 | return -ENOENT; |
465 | nd->mnt = rpc_get_mount(); | 467 | |
466 | if (IS_ERR(nd->mnt)) { | 468 | mnt = rpc_get_mount(); |
469 | if (IS_ERR(mnt)) { | ||
467 | printk(KERN_WARNING "%s: %s failed to mount " | 470 | printk(KERN_WARNING "%s: %s failed to mount " |
468 | "pseudofilesystem \n", __FILE__, __FUNCTION__); | 471 | "pseudofilesystem \n", __FILE__, __FUNCTION__); |
469 | return PTR_ERR(nd->mnt); | 472 | return PTR_ERR(mnt); |
470 | } | 473 | } |
471 | mntget(nd->mnt); | ||
472 | nd->dentry = dget(rpc_mount->mnt_root); | ||
473 | nd->last_type = LAST_ROOT; | ||
474 | nd->flags = LOOKUP_PARENT; | ||
475 | nd->depth = 0; | ||
476 | 474 | ||
477 | if (path_walk(path, nd)) { | 475 | if (vfs_path_lookup(mnt->mnt_root, mnt, path, LOOKUP_PARENT, nd)) { |
478 | printk(KERN_WARNING "%s: %s failed to find path %s\n", | 476 | printk(KERN_WARNING "%s: %s failed to find path %s\n", |
479 | __FILE__, __FUNCTION__, path); | 477 | __FILE__, __FUNCTION__, path); |
480 | rpc_put_mount(); | 478 | rpc_put_mount(); |