]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/ceph/dir.c
fs: dcache scale subdirs
[karo-tx-linux.git] / fs / ceph / dir.c
index 571f270dca0faf851f620eb7f2f38dae9d30f7af..2c924e8d85fec0a4c1a3926e60a6bf632d250a33 100644 (file)
@@ -113,6 +113,7 @@ static int __dcache_readdir(struct file *filp,
             last);
 
        spin_lock(&dcache_lock);
+       spin_lock(&parent->d_lock);
 
        /* start at beginning? */
        if (filp->f_pos == 2 || last == NULL ||
@@ -136,7 +137,7 @@ more:
                        fi->at_end = 1;
                        goto out_unlock;
                }
-               spin_lock(&dentry->d_lock);
+               spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
                if (!d_unhashed(dentry) && dentry->d_inode &&
                    ceph_snap(dentry->d_inode) != CEPH_SNAPDIR &&
                    ceph_ino(dentry->d_inode) != CEPH_INO_CEPH &&
@@ -154,6 +155,7 @@ more:
 
        dget_dlock(dentry);
        spin_unlock(&dentry->d_lock);
+       spin_unlock(&parent->d_lock);
        spin_unlock(&dcache_lock);
 
        dout(" %llu (%llu) dentry %p %.*s %p\n", di->offset, filp->f_pos,
@@ -188,10 +190,12 @@ more:
        }
 
        spin_lock(&dcache_lock);
+       spin_lock(&parent->d_lock);
        p = p->prev;    /* advance to next dentry */
        goto more;
 
 out_unlock:
+       spin_unlock(&parent->d_lock);
        spin_unlock(&dcache_lock);
 out:
        if (last)