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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux