Re: [PATCH 1/1] sunrpc: Use path_component_lookup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2007-05-05 at 20:52 -0400, Josef 'Jeff' Sipek wrote:
> use path_component_lookup instead of open-coding the necessary
> functionality.
> 
> Signed-off-by: Josef 'Jeff' Sipek <jsipek@xxxxxxxxxxxxx>
> ---
>  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 9b9ea50..c93a454 100644
> --- a/net/sunrpc/rpc_pipe.c
> +++ b/net/sunrpc/rpc_pipe.c
> @@ -451,21 +451,19 @@ void rpc_put_mount(void)
>  static int
>  rpc_lookup_parent(char *path, struct nameidata *nd)
>  {
> +	struct vfsmount *mnt;
> +
>  	if (path[0] == '\0')
>  		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 "
>  			       "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 (path_component_lookup(mnt->mnt_root, mnt, path, LOOKUP_PARENT, nd)) {
>  		printk(KERN_WARNING "%s: %s failed to find path %s\n",
>  				__FILE__, __FUNCTION__, path);
>  		rpc_put_mount();

Thanks! That looks good.

Acked-by: Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>

Cheers
  Trond
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux