summaryrefslogtreecommitdiff
path: root/fs/notify
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2010-01-29 15:38:22 -0800
committerThomas Gleixner <tglx@linutronix.de>2010-04-27 17:32:34 +0200
commit0ae6d894c8a82fc64d7203a5d342304005ba2aae (patch)
treeaad267a218360f860efdbce653767f4bffc9d8c3 /fs/notify
parentb9ab2f38fdee96ff49b8a7bbb65cbfc60921e40c (diff)
downloadlwn-0ae6d894c8a82fc64d7203a5d342304005ba2aae.tar.gz
lwn-0ae6d894c8a82fc64d7203a5d342304005ba2aae.zip
fs-dcache-scale-i_dentry
Add a new lock, dcache_inode_lock, to protect the inode's i_dentry list from concurrent modification. d_alias is also protected by d_lock. Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: John Stultz <johnstul@us.ibm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/notify')
-rw-r--r--fs/notify/fsnotify.c2
-rw-r--r--fs/notify/inotify/inotify.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
index 03ee7430867d..709dae31b03b 100644
--- a/fs/notify/fsnotify.c
+++ b/fs/notify/fsnotify.c
@@ -53,6 +53,7 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode)
watched = fsnotify_inode_watches_children(inode);
spin_lock(&dcache_lock);
+ spin_lock(&dcache_inode_lock);
/* run all of the dentries associated with this inode. Since this is a
* directory, there damn well better only be one item on this list */
list_for_each_entry(alias, &inode->i_dentry, d_alias) {
@@ -75,6 +76,7 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode)
}
spin_unlock(&alias->d_lock);
}
+ spin_unlock(&dcache_inode_lock);
spin_unlock(&dcache_lock);
}
diff --git a/fs/notify/inotify/inotify.c b/fs/notify/inotify/inotify.c
index a838e58e6e4a..977d3f6f79e1 100644
--- a/fs/notify/inotify/inotify.c
+++ b/fs/notify/inotify/inotify.c
@@ -186,6 +186,7 @@ static void set_dentry_child_flags(struct inode *inode, int watched)
struct dentry *alias;
spin_lock(&dcache_lock);
+ spin_lock(&dcache_inode_lock);
list_for_each_entry(alias, &inode->i_dentry, d_alias) {
struct dentry *child;
@@ -203,6 +204,7 @@ static void set_dentry_child_flags(struct inode *inode, int watched)
}
spin_unlock(&alias->d_lock);
}
+ spin_unlock(&dcache_inode_lock);
spin_unlock(&dcache_lock);
}