summaryrefslogtreecommitdiffstats
path: root/fs/notify/inode_mark.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2017-03-14 14:29:35 +0100
committerJan Kara <jack@suse.cz>2017-04-10 17:37:35 +0200
commit86ffe245c430f07f95d5d28d3b694ea72f4492e7 (patch)
tree91f46db0135cc58cfb5dd1114962bc4781c456fe /fs/notify/inode_mark.c
parent9dd813c15b2c101168808d4f5941a29985758973 (diff)
downloadlinux-86ffe245c430f07f95d5d28d3b694ea72f4492e7.tar.gz
linux-86ffe245c430f07f95d5d28d3b694ea72f4492e7.tar.bz2
linux-86ffe245c430f07f95d5d28d3b694ea72f4492e7.zip
fsnotify: Move object pointer to fsnotify_mark_connector
Move pointer to inode / vfsmount from mark itself to the fsnotify_mark_connector structure. This is another step on the path towards decoupling inode / vfsmount lifetime from notification mark lifetime. 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, 7 insertions, 11 deletions
diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c
index e8c6b822ff8d..1644ba09efd4 100644
--- a/fs/notify/inode_mark.c
+++ b/fs/notify/inode_mark.c
@@ -45,7 +45,7 @@ void fsnotify_recalc_inode_mask(struct inode *inode)
void fsnotify_destroy_inode_mark(struct fsnotify_mark *mark)
{
- struct inode *inode = mark->inode;
+ struct inode *inode = mark->connector->inode;
BUG_ON(!mutex_is_locked(&mark->group->mark_mutex));
assert_spin_locked(&mark->lock);
@@ -53,7 +53,7 @@ void fsnotify_destroy_inode_mark(struct fsnotify_mark *mark)
spin_lock(&inode->i_lock);
hlist_del_init_rcu(&mark->obj_list);
- mark->inode = NULL;
+ mark->connector = NULL;
/*
* this mark is now off the inode->i_fsnotify_marks list and we
@@ -69,7 +69,7 @@ void fsnotify_destroy_inode_mark(struct fsnotify_mark *mark)
*/
void fsnotify_clear_inode_marks_by_group(struct fsnotify_group *group)
{
- fsnotify_clear_marks_by_group_flags(group, FSNOTIFY_MARK_FLAG_INODE);
+ fsnotify_clear_marks_by_group_flags(group, FSNOTIFY_OBJ_TYPE_INODE);
}
/*
@@ -99,11 +99,10 @@ void fsnotify_set_inode_mark_mask_locked(struct fsnotify_mark *mark,
assert_spin_locked(&mark->lock);
- if (mask &&
- mark->inode &&
+ if (mask && mark->connector &&
!(mark->flags & FSNOTIFY_MARK_FLAG_OBJECT_PINNED)) {
mark->flags |= FSNOTIFY_MARK_FLAG_OBJECT_PINNED;
- inode = igrab(mark->inode);
+ inode = igrab(mark->connector->inode);
/*
* we shouldn't be able to get here if the inode wasn't
* already safely held in memory. But bug in case it
@@ -126,15 +125,12 @@ int fsnotify_add_inode_mark(struct fsnotify_mark *mark,
{
int ret;
- mark->flags |= FSNOTIFY_MARK_FLAG_INODE;
-
BUG_ON(!mutex_is_locked(&group->mark_mutex));
assert_spin_locked(&mark->lock);
spin_lock(&inode->i_lock);
- mark->inode = inode;
- ret = fsnotify_add_mark_list(&inode->i_fsnotify_marks, mark,
- allow_dups);
+ ret = fsnotify_add_mark_list(&inode->i_fsnotify_marks, mark, inode,
+ NULL, allow_dups);
inode->i_fsnotify_mask = fsnotify_recalc_mask(inode->i_fsnotify_marks);
spin_unlock(&inode->i_lock);