From b812a9f5896379b6cff2ac168ddb5b89037d8e78 Mon Sep 17 00:00:00 2001 From: Amir Goldstein Date: Sat, 23 Jun 2018 17:54:48 +0300 Subject: fsnotify: pass connp and object type to fsnotify_add_mark() Instead of passing inode and vfsmount arguments to fsnotify_add_mark() and its _locked variant, pass an abstract object pointer and the object type. The helpers fsnotify_obj_{inode,mount} are added to get the concrete object pointer from abstract object pointer. Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara --- fs/notify/fsnotify.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'fs/notify/fsnotify.h') diff --git a/fs/notify/fsnotify.h b/fs/notify/fsnotify.h index 94cedf8264ba..caeee042d1cc 100644 --- a/fs/notify/fsnotify.h +++ b/fs/notify/fsnotify.h @@ -9,6 +9,16 @@ #include "../mount.h" +static inline struct inode *fsnotify_obj_inode(fsnotify_connp_t *connp) +{ + return container_of(connp, struct inode, i_fsnotify_marks); +} + +static inline struct mount *fsnotify_obj_mount(fsnotify_connp_t *connp) +{ + return container_of(connp, struct mount, mnt_fsnotify_marks); +} + /* destroy all events sitting in this groups notification queue */ extern void fsnotify_flush_notify(struct fsnotify_group *group); -- cgit v1.2.3-70-g09d2