summaryrefslogtreecommitdiffstats
path: root/fs/notify/dnotify
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2009-12-18 03:24:25 +0100
committerEric Paris <eparis@redhat.com>2010-07-28 15:58:54 +0200
commit35566087099c3ff8901d65ee98af56347ee66e5a (patch)
treee4e56bcf787e5f100fa1ea0138c417e1203b10ae /fs/notify/dnotify
parentdnotify: rename mark_entry to mark (diff)
downloadlinux-35566087099c3ff8901d65ee98af56347ee66e5a.tar.xz
linux-35566087099c3ff8901d65ee98af56347ee66e5a.zip
fsnotify: take inode->i_lock inside fsnotify_find_mark_entry()
All callers to fsnotify_find_mark_entry() except one take and release inode->i_lock around the call. Take the lock inside fsnotify_find_mark_entry() instead. Signed-off-by: Andreas Gruenbacher <agruen@suse.de> Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs/notify/dnotify')
-rw-r--r--fs/notify/dnotify/dnotify.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/fs/notify/dnotify/dnotify.c b/fs/notify/dnotify/dnotify.c
index 3efb8b9a572d..cac2eb896639 100644
--- a/fs/notify/dnotify/dnotify.c
+++ b/fs/notify/dnotify/dnotify.c
@@ -95,11 +95,7 @@ static int dnotify_handle_event(struct fsnotify_group *group,
to_tell = event->to_tell;
- spin_lock(&to_tell->i_lock);
fsn_mark = fsnotify_find_mark(group, to_tell);
- spin_unlock(&to_tell->i_lock);
-
- /* unlikely since we alreay passed dnotify_should_send_event() */
if (unlikely(!fsn_mark))
return 0;
dn_mark = container_of(fsn_mark, struct dnotify_mark, fsn_mark);
@@ -147,11 +143,7 @@ static bool dnotify_should_send_event(struct fsnotify_group *group,
if (!S_ISDIR(inode->i_mode))
return false;
- spin_lock(&inode->i_lock);
fsn_mark = fsnotify_find_mark(group, inode);
- spin_unlock(&inode->i_lock);
-
- /* no mark means no dnotify watch */
if (!fsn_mark)
return false;
@@ -201,9 +193,7 @@ void dnotify_flush(struct file *filp, fl_owner_t id)
if (!S_ISDIR(inode->i_mode))
return;
- spin_lock(&inode->i_lock);
fsn_mark = fsnotify_find_mark(dnotify_group, inode);
- spin_unlock(&inode->i_lock);
if (!fsn_mark)
return;
dn_mark = container_of(fsn_mark, struct dnotify_mark, fsn_mark);
@@ -356,9 +346,7 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
mutex_lock(&dnotify_mark_mutex);
/* add the new_fsn_mark or find an old one. */
- spin_lock(&inode->i_lock);
fsn_mark = fsnotify_find_mark(dnotify_group, inode);
- spin_unlock(&inode->i_lock);
if (fsn_mark) {
dn_mark = container_of(fsn_mark, struct dnotify_mark, fsn_mark);
spin_lock(&fsn_mark->lock);