summaryrefslogtreecommitdiffstats
path: root/fs/notify/fanotify/fanotify.h
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2019-01-10 19:04:37 +0200
committerJan Kara <jack@suse.cz>2019-02-07 16:38:35 +0100
commit77115225acc67d9ac4b15f04dd138006b9cd1ef2 (patch)
tree6f5bce4240d6975c10ffee2d447035b1783b0e38 /fs/notify/fanotify/fanotify.h
parenta8b13aa20afb69161b5123b4f1acc7ea0a03d360 (diff)
downloadlinux-77115225acc67d9ac4b15f04dd138006b9cd1ef2.tar.bz2
fanotify: cache fsid in fsnotify_mark_connector
For FAN_REPORT_FID, we need to encode fid with fsid of the filesystem on every event. To avoid having to call vfs_statfs() on every event to get fsid, we store the fsid in fsnotify_mark_connector on the first time we add a mark and on handle event we use the cached fsid. Subsequent calls to add mark on the same object are expected to pass the same fsid, so the call will fail on cached fsid mismatch. If an event is reported on several mark types (inode, mount, filesystem), all connectors should already have the same fsid, so we use the cached fsid from the first connector. [JK: Simplify code flow around fanotify_get_fid() make fsid argument of fsnotify_add_mark_locked() unconditional] Suggested-by: Jan Kara <jack@suse.cz> Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/notify/fanotify/fanotify.h')
-rw-r--r--fs/notify/fanotify/fanotify.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/notify/fanotify/fanotify.h b/fs/notify/fanotify/fanotify.h
index 4aafc7144c3d..5b072afa4e19 100644
--- a/fs/notify/fanotify/fanotify.h
+++ b/fs/notify/fanotify/fanotify.h
@@ -131,5 +131,6 @@ static inline struct fanotify_event *FANOTIFY_E(struct fsnotify_event *fse)
}
struct fanotify_event *fanotify_alloc_event(struct fsnotify_group *group,
- struct inode *inode, u32 mask,
- const struct path *path);
+ struct inode *inode, u32 mask,
+ const struct path *path,
+ __kernel_fsid_t *fsid);