From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: [PATCH] kill walk_init_root Date: Wed, 5 Nov 2008 15:07:21 +0100 Message-ID: <20081105140721.GC5012@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: viro@zeniv.linux.org.uk Return-path: Received: from verein.lst.de ([213.95.11.210]:52930 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753665AbYKEOHY (ORCPT ); Wed, 5 Nov 2008 09:07:24 -0500 Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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. Signed-off-by: Christoph Hellwig 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;