fs: dcache scale subdirs
[linux-flexiantxendom0-natty.git] / fs / ncpfs / dir.c
index bbbf792..102278e 100644 (file)
@@ -392,6 +392,7 @@ ncp_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);
@@ -400,11 +401,13 @@ ncp_dget_fpos(struct dentry *dentry, struct dentry *parent, unsigned long fpos)
                                dget_locked(dent);
                        else
                                dent = NULL;
+                       spin_unlock(&parent->d_lock);
                        spin_unlock(&dcache_lock);
                        goto out;
                }
                next = next->next;
        }
+       spin_unlock(&parent->d_lock);
        spin_unlock(&dcache_lock);
        return NULL;