All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timothy Shimmin <tes@sgi.com>
To: Christoph Hellwig <hch@lst.de>
Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] kill walk_init_root
Date: Thu, 06 Nov 2008 14:18:35 +1100	[thread overview]
Message-ID: <4912620B.5070901@sgi.com> (raw)
In-Reply-To: <20081105140721.GC5012@lst.de>

Christoph Hellwig wrote:
> walk_init_root is a tiny helper that is marked __always_inline, has just
> one caller and an unused argument.  Just merge it into the caller.
> 
Looks good.

Reviewed-by: Tim Shimmin <tes@sgi.com>
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> Index: linux-2.6/fs/namei.c
> ===================================================================
> --- linux-2.6.orig/fs/namei.c	2008-11-04 12:24:53.000000000 +0100
> +++ linux-2.6/fs/namei.c	2008-11-04 12:26:04.000000000 +0100
> @@ -521,18 +521,6 @@ out_unlock:
>  	return result;
>  }
>  
> -/* SMP-safe */
> -static __always_inline void
> -walk_init_root(const char *name, struct nameidata *nd)
> -{
> -	struct fs_struct *fs = current->fs;
> -
> -	read_lock(&fs->lock);
> -	nd->path = fs->root;
> -	path_get(&fs->root);
> -	read_unlock(&fs->lock);
> -}
> -
>  /*
>   * Wrapper to retry pathname resolution whenever the underlying
>   * file system returns an ESTALE.
> @@ -570,9 +558,16 @@ static __always_inline int __vfs_follow_
>  		goto fail;
>  
>  	if (*link == '/') {
> +		struct fs_struct *fs = current->fs;
> +
>  		path_put(&nd->path);
> -		walk_init_root(link, nd);
> +
> +		read_lock(&fs->lock);
> +		nd->path = fs->root;
> +		path_get(&fs->root);
> +		read_unlock(&fs->lock);
>  	}
> +
>  	res = link_path_walk(link, nd);
>  	if (nd->depth || res || nd->last_type!=LAST_NORM)
>  		return res;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


      reply	other threads:[~2008-11-06  3:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-05 14:07 [PATCH] kill walk_init_root Christoph Hellwig
2008-11-06  3:18 ` Timothy Shimmin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4912620B.5070901@sgi.com \
    --to=tes@sgi.com \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.