From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755119AbbDTSOl (ORCPT ); Mon, 20 Apr 2015 14:14:41 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:34770 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754203AbbDTSNM (ORCPT ); Mon, 20 Apr 2015 14:13:12 -0400 From: Al Viro To: Linus Torvalds Cc: Neil Brown , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 18/24] link_path_walk: cleanup - turn goto start; into continue; Date: Mon, 20 Apr 2015 19:13:02 +0100 Message-Id: <1429553588-24764-18-git-send-email-viro@ZenIV.linux.org.uk> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <20150420181222.GK889@ZenIV.linux.org.uk> References: <20150420181222.GK889@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Viro Deal with skipping leading slashes before what used to be the recursive call. That way we can get rid of that goto completely. Signed-off-by: Al Viro --- fs/namei.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index 975918f..71c9546 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1775,11 +1775,10 @@ static int link_path_walk(const char *name, struct nameidata *nd) struct path next; int err; -start: while (*name=='/') name++; if (!*name) - goto OK; + return 0; /* At this point we know we have a real path component. */ for(;;) { @@ -1878,11 +1877,15 @@ Walked: nd->path = nd->root; path_get(&nd->root); nd->flags |= LOOKUP_JUMPED; + while (unlikely(*++s == '/')) + ; } nd->inode = nd->path.dentry->d_inode; last->name = name; + if (!*s) + goto OK; name = s; - goto start; + continue; } } if (!d_can_lookup(nd->path.dentry)) { -- 2.1.4