All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: maneesh@in.ibm.com
Cc: linux-kernel@vger.kernel.org,
	viro@parcelfarce.linux.theplanet.co.uk, dipankar@in.ibm.com,
	Paul.McKenney@us.ibm.com
Subject: Re: [patch 1/2] vfsmount_lock
Date: Wed, 21 May 2003 02:35:23 -0700	[thread overview]
Message-ID: <20030521023523.655bc8f2.akpm@digeo.com> (raw)
In-Reply-To: <20030521092502.GD1198@in.ibm.com>

Maneesh Soni <maneesh@in.ibm.com> wrote:
>
>  struct vfsmount *lookup_mnt(struct vfsmount *mnt, struct dentry *dentry)
>   {
>   	struct list_head * head = mount_hashtable + hash(mnt, dentry);
>   	struct list_head * tmp = head;
>  -	struct vfsmount *p;
>  +	struct vfsmount *p, *found = NULL;
>   
>  +	spin_lock(&vfsmount_lock);
>   	for (;;) {
>   		tmp = tmp->next;
>   		p = NULL;
>   		if (tmp == head)
>   			break;
>   		p = list_entry(tmp, struct vfsmount, mnt_hash);
>  -		if (p->mnt_parent == mnt && p->mnt_mountpoint == dentry)
>  +		if (p->mnt_parent == mnt && p->mnt_mountpoint == dentry) {
>  +			found = mntget(p);
>   			break;
>  +		}
>   	}
>  -	return p;
>  +	spin_lock(&vfsmount_lock);
>  +	return found;
>   }

err, how many times do you want to spin that lock?


  parent reply	other threads:[~2003-05-21  9:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-21  9:25 [patch 1/2] vfsmount_lock Maneesh Soni
2003-05-21  9:26 ` [patch 2/2] lockfree lookup_mnt Maneesh Soni
2003-05-21  9:35 ` Andrew Morton [this message]
2003-05-21  9:38   ` [patch 1/2] vfsmount_lock Paul Rolland
2003-05-21  9:43   ` Maneesh Soni
2003-05-21  9:45     ` [patch 2/2] lockfree lookup_mnt Maneesh Soni
2003-05-21  9:53   ` [patch 1/2] vfsmount_lock Dipankar Sarma

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=20030521023523.655bc8f2.akpm@digeo.com \
    --to=akpm@digeo.com \
    --cc=Paul.McKenney@us.ibm.com \
    --cc=dipankar@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maneesh@in.ibm.com \
    --cc=viro@parcelfarce.linux.theplanet.co.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.