]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - include/linux/fsnotify_backend.h
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / include / linux / fsnotify_backend.h
index 7380763595d30accb255728f45682550cc540d63..69ad89b504895431265cbb106b53cc8be543089b 100644 (file)
@@ -329,9 +329,15 @@ static inline void __fsnotify_update_dcache_flags(struct dentry *dentry)
 {
        struct dentry *parent;
 
-       assert_spin_locked(&dcache_lock);
        assert_spin_locked(&dentry->d_lock);
 
+       /*
+        * Serialisation of setting PARENT_WATCHED on the dentries is provided
+        * by d_lock. If inotify_inode_watched changes after we have taken
+        * d_lock, the following __fsnotify_update_child_dentry_flags call will
+        * find our entry, so it will spin until we complete here, and update
+        * us with the new state.
+        */
        parent = dentry->d_parent;
        if (parent->d_inode && fsnotify_inode_watches_children(parent->d_inode))
                dentry->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED;
@@ -341,15 +347,12 @@ static inline void __fsnotify_update_dcache_flags(struct dentry *dentry)
 
 /*
  * fsnotify_d_instantiate - instantiate a dentry for inode
- * Called with dcache_lock held.
  */
 static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode *inode)
 {
        if (!inode)
                return;
 
-       assert_spin_locked(&dcache_lock);
-
        spin_lock(&dentry->d_lock);
        __fsnotify_update_dcache_flags(dentry);
        spin_unlock(&dentry->d_lock);