[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20071126103028.GQ8181@ftp.linux.org.uk>
Date: Mon, 26 Nov 2007 10:30:28 +0000
From: Al Viro <viro@....linux.org.uk>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Dmitri Vorobiev <dmitri.vorobiev@...il.com>, zach.brown@...cle.com,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [2.6.24-rc3-mm1] loop cleanup in fs/namespace.c - repost
On Wed, Nov 21, 2007 at 03:24:33PM -0800, Andrew Morton wrote:
> -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;
> }
> }
>
> This patch has no changelog which I can use.
BTW, I have a problem with that one. The change is misleading; FWIW,
I'm very tempted to turn that into tail recursion, with
if (!atomic_dec_and_lock(&mnt->mnt_count, &vfsmount_lock))
return;
in the very beginning (i.e. invert the test and pull the body to top level).
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists