summaryrefslogtreecommitdiffstats
path: root/fs/notify/mark.c
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2018-09-01 10:41:11 +0300
committerJan Kara <jack@suse.cz>2018-09-03 15:14:01 +0200
commit1e6cb72399fd58b38a1c11055ef18fe01f535cda (patch)
tree1d2867b32812df127a09712ca5c0362bc6f156c2 /fs/notify/mark.c
parent9bdda4e9cf2dcecb60a0683b10ffb8cd7e5f2f45 (diff)
downloadlinux-1e6cb72399fd58b38a1c11055ef18fe01f535cda.tar.bz2
fsnotify: add super block object type
Add the infrastructure to attach a mark to a super_block struct and detach all attached marks when super block is destroyed. This is going to be used by fanotify backend to setup super block marks. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/notify/mark.c')
-rw-r--r--fs/notify/mark.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index 59cdb27826de..b5172ccb2e60 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -115,6 +115,8 @@ static __u32 *fsnotify_conn_mask_p(struct fsnotify_mark_connector *conn)
return &fsnotify_conn_inode(conn)->i_fsnotify_mask;
else if (conn->type == FSNOTIFY_OBJ_TYPE_VFSMOUNT)
return &fsnotify_conn_mount(conn)->mnt_fsnotify_mask;
+ else if (conn->type == FSNOTIFY_OBJ_TYPE_SB)
+ return &fsnotify_conn_sb(conn)->s_fsnotify_mask;
return NULL;
}
@@ -192,6 +194,8 @@ static struct inode *fsnotify_detach_connector_from_object(
inode->i_fsnotify_mask = 0;
} else if (conn->type == FSNOTIFY_OBJ_TYPE_VFSMOUNT) {
fsnotify_conn_mount(conn)->mnt_fsnotify_mask = 0;
+ } else if (conn->type == FSNOTIFY_OBJ_TYPE_SB) {
+ fsnotify_conn_sb(conn)->s_fsnotify_mask = 0;
}
rcu_assign_pointer(*(conn->obj), NULL);