summaryrefslogtreecommitdiff
path: root/fs/notify/fsnotify.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/notify/fsnotify.h')
-rw-r--r--fs/notify/fsnotify.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/notify/fsnotify.h b/fs/notify/fsnotify.h
index fde74eb333cc..6d9951aac449 100644
--- a/fs/notify/fsnotify.h
+++ b/fs/notify/fsnotify.h
@@ -27,6 +27,21 @@ static inline struct super_block *fsnotify_conn_sb(
return container_of(conn->obj, struct super_block, s_fsnotify_marks);
}
+static inline struct super_block *fsnotify_object_sb(void *obj,
+ enum fsnotify_obj_type obj_type)
+{
+ switch (obj_type) {
+ case FSNOTIFY_OBJ_TYPE_INODE:
+ return ((struct inode *)obj)->i_sb;
+ case FSNOTIFY_OBJ_TYPE_VFSMOUNT:
+ return ((struct vfsmount *)obj)->mnt_sb;
+ case FSNOTIFY_OBJ_TYPE_SB:
+ return (struct super_block *)obj;
+ default:
+ return NULL;
+ }
+}
+
static inline struct super_block *fsnotify_connector_sb(
struct fsnotify_mark_connector *conn)
{