lkml.org 
[lkml]   [2003]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [patch 1/2] vfsmount_lock
    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?

    -
    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/

    \
     
     \ /
      Last update: 2005-03-22 13:35    [W:0.019 / U:32.896 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site