fs: dcache scale subdirs
[linux-flexiantxendom0-natty.git] / drivers / staging / smbfs / cache.c
index 0beded2..920434b 100644 (file)
@@ -63,6 +63,7 @@ smb_invalidate_dircache_entries(struct dentry *parent)
        struct dentry *dentry;
 
        spin_lock(&dcache_lock);
+       spin_lock(&parent->d_lock);
        next = parent->d_subdirs.next;
        while (next != &parent->d_subdirs) {
                dentry = list_entry(next, struct dentry, d_u.d_child);
@@ -70,6 +71,7 @@ smb_invalidate_dircache_entries(struct dentry *parent)
                smb_age_dentry(server, dentry);
                next = next->next;
        }
+       spin_unlock(&parent->d_lock);
        spin_unlock(&dcache_lock);
 }
 
@@ -97,6 +99,7 @@ smb_dget_fpos(struct dentry *dentry, struct dentry *parent, unsigned long fpos)
 
        /* If a pointer is invalid, we search the dentry. */
        spin_lock(&dcache_lock);
+       spin_lock(&parent->d_lock);
        next = parent->d_subdirs.next;
        while (next != &parent->d_subdirs) {
                dent = list_entry(next, struct dentry, d_u.d_child);
@@ -111,6 +114,7 @@ smb_dget_fpos(struct dentry *dentry, struct dentry *parent, unsigned long fpos)
        }
        dent = NULL;
 out_unlock:
+       spin_unlock(&parent->d_lock);
        spin_unlock(&dcache_lock);
        return dent;
 }