summaryrefslogtreecommitdiff
path: root/fs/notify/inode_mark.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2017-03-15 09:16:27 +0100
committerJan Kara <jack@suse.cz>2017-04-10 17:37:35 +0200
commita242677bb1e6faa9bd82bd33afb2621071258231 (patch)
tree853a675a0c61c182b834b1ced7d7e745c1eb3133 /fs/notify/inode_mark.c
parent0810b4f9f207910d90aee56d312d25f334796363 (diff)
fsnotify: Move locking into fsnotify_recalc_mask()
Move locking of locks protecting a list of marks into fsnotify_recalc_mask(). This reduces code churn in the following patch which changes the lock protecting the list of marks. Reviewed-by: Miklos Szeredi <mszeredi@redhat.com> Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/notify/inode_mark.c')
-rw-r--r--fs/notify/inode_mark.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c
index 87bef7d802db..9b2f4e6eb8eb 100644
--- a/fs/notify/inode_mark.c
+++ b/fs/notify/inode_mark.c
@@ -30,17 +30,9 @@
#include "../internal.h"
-/*
- * Recalculate the inode->i_fsnotify_mask, or the mask of all FS_* event types
- * any notifier is interested in hearing for this inode.
- */
void fsnotify_recalc_inode_mask(struct inode *inode)
{
- spin_lock(&inode->i_lock);
- inode->i_fsnotify_mask = fsnotify_recalc_mask(inode->i_fsnotify_marks);
- spin_unlock(&inode->i_lock);
-
- __fsnotify_update_child_dentry_flags(inode);
+ fsnotify_recalc_mask(inode->i_fsnotify_marks);
}
struct inode *fsnotify_destroy_inode_mark(struct fsnotify_mark *mark)
@@ -57,14 +49,10 @@ struct inode *fsnotify_destroy_inode_mark(struct fsnotify_mark *mark)
empty = hlist_empty(&mark->connector->list);
mark->connector = NULL;
- /*
- * this mark is now off the inode->i_fsnotify_marks list and we
- * hold the inode->i_lock, so this is the perfect time to update the
- * inode->i_fsnotify_mask
- */
- inode->i_fsnotify_mask = fsnotify_recalc_mask(inode->i_fsnotify_marks);
spin_unlock(&inode->i_lock);
+ fsnotify_recalc_mask(inode->i_fsnotify_marks);
+
return empty ? inode : NULL;
}