Re: [patch 1/2] vfsmount_lock

From: Dipankar Sarma (dipankar@in.ibm.com)
Date: Wed May 21 2003 - 04:53:14 EST


On Wed, May 21, 2003 at 02:35:23AM -0700, Andrew Morton wrote:
> Maneesh Soni <maneesh@in.ibm.com> wrote:
> >
> > struct vfsmount *lookup_mnt(struct vfsmount *mnt, struct dentry *dentry)
> > {
> > + 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?

None, if you apply the second patch ;-)

Thanks
Dipankar
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri May 23 2003 - 22:00:44 EST