linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kusanagi Kouichi <slash@ac.auone-net.jp>
To: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] vfs: Replace goto with do-while
Date: Sun, 6 Jan 2013 19:30:28 +0900	[thread overview]
Message-ID: <20130106103029.28D5E3E403B@msa101.auone-net.jp> (raw)

Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
---
 fs/namespace.c |   17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index 55605c5..467ca80 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -71,15 +71,14 @@ static int mnt_alloc_id(struct mount *mnt)
 {
 	int res;
 
-retry:
-	ida_pre_get(&mnt_id_ida, GFP_KERNEL);
-	spin_lock(&mnt_id_lock);
-	res = ida_get_new_above(&mnt_id_ida, mnt_id_start, &mnt->mnt_id);
-	if (!res)
-		mnt_id_start = mnt->mnt_id + 1;
-	spin_unlock(&mnt_id_lock);
-	if (res == -EAGAIN)
-		goto retry;
+	do {
+		ida_pre_get(&mnt_id_ida, GFP_KERNEL);
+		spin_lock(&mnt_id_lock);
+		res = ida_get_new_above(&mnt_id_ida, mnt_id_start, &mnt->mnt_id);
+		if (!res)
+			mnt_id_start = mnt->mnt_id + 1;
+		spin_unlock(&mnt_id_lock);
+	} while (res == -EAGAIN);
 
 	return res;
 }
-- 
1.7.10.4

                 reply	other threads:[~2013-01-06 10:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20130106103029.28D5E3E403B@msa101.auone-net.jp \
    --to=slash@ac.auone-net.jp \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).