Re: [PATCH]loop cleanup in fs/namespace.c - repost

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Zach Brown <zach.brown@...>
Cc: <linux-fsdevel@...>, Linux-kernel <linux-kernel@...>
Date: Wednesday, November 21, 2007 - 3:54 pm

Zach Brown пишет:

Oops, my fault. Of course, I tested the patch, but kernel modules are disabled in my test setup, so I missed the error. Thanks for pointing that out, Zach.

Enclosed to this message is a new patch, which replaces the goto-loop by the while-based one, but leaves the EXPORT_SYMBOL macro intact.

And yes, I agree that for this routine, the break statement looks more appropriate than return.


Signed-off-by Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
---
diff --git a/fs/namespace.c b/fs/namespace.c
index 0608388..410e766 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -278,19 +278,17 @@ static inline void __mntput(struct vfsmo
 
 void mntput_no_expire(struct vfsmount *mnt)
 {
-repeat:
-	if (atomic_dec_and_lock(&mnt->mnt_count, &vfsmount_lock)) {
+	while (atomic_dec_and_lock(&mnt->mnt_count, &vfsmount_lock)) {
 		if (likely(!mnt->mnt_pinned)) {
 			spin_unlock(&vfsmount_lock);
 			__mntput(mnt);
-			return;
+			break;
 		}
 		atomic_add(mnt->mnt_pinned + 1, &mnt->mnt_count);
 		mnt->mnt_pinned = 0;
 		spin_unlock(&vfsmount_lock);
 		acct_auto_close_mnt(mnt);
 		security_sb_umount_close(mnt);
-		goto repeat;
 	}
 }
 
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH]loop cleanup in fs/namespace.c - repost, Dmitri Vorobiev, (Wed Nov 21, 1:57 pm)
Re: [PATCH]loop cleanup in fs/namespace.c - repost, Zach Brown, (Wed Nov 21, 3:06 pm)
Re: [PATCH]loop cleanup in fs/namespace.c - repost, Dmitri Vorobiev, (Wed Nov 21, 3:54 pm)
Re: [PATCH]loop cleanup in fs/namespace.c - repost, Zach Brown, (Wed Nov 21, 4:46 pm)