]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/notify/fsnotify.c
fs: dcache scale subdirs
[karo-tx-linux.git] / fs / notify / fsnotify.c
index 20dc218707ca59afc4c5b42de6cd7d614ca49340..aa4f25e803f61b4e2377b9ff535b3da7fc51a915 100644 (file)
@@ -68,17 +68,19 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode)
                /* run all of the children of the original inode and fix their
                 * d_flags to indicate parental interest (their parent is the
                 * original inode) */
+               spin_lock(&alias->d_lock);
                list_for_each_entry(child, &alias->d_subdirs, d_u.d_child) {
                        if (!child->d_inode)
                                continue;
 
-                       spin_lock(&child->d_lock);
+                       spin_lock_nested(&child->d_lock, DENTRY_D_LOCK_NESTED);
                        if (watched)
                                child->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED;
                        else
                                child->d_flags &= ~DCACHE_FSNOTIFY_PARENT_WATCHED;
                        spin_unlock(&child->d_lock);
                }
+               spin_unlock(&alias->d_lock);
        }
        spin_unlock(&dcache_lock);
 }