Remove fsnotify_sb_watched_objects() helper since it's now used only in fsnotify_get_sb_watched_objects() and fsnotify_put_sb_watched_objects(). Also make those two functions take sbinfo as that will be more common in the future. Signed-off-by: Jan Kara --- fs/notify/mark.c | 20 ++++++++++---------- include/linux/fsnotify_backend.h | 5 ----- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/fs/notify/mark.c b/fs/notify/mark.c index 3df230e218fb..f6a197c63c1d 100644 --- a/fs/notify/mark.c +++ b/fs/notify/mark.c @@ -138,20 +138,20 @@ __u32 fsnotify_conn_mask(struct fsnotify_mark_connector *conn) return READ_ONCE(*fsnotify_conn_mask_p(conn)); } -static void fsnotify_get_sb_watched_objects(struct super_block *sb) +static void fsnotify_get_sb_watched_objects(struct fsnotify_sb_info *sbinfo) { - atomic_long_inc(fsnotify_sb_watched_objects(sb)); + atomic_long_inc(&sbinfo->watched_objects[0]); } -static void fsnotify_put_sb_watched_objects(struct super_block *sb) +static void fsnotify_put_sb_watched_objects(struct fsnotify_sb_info *sbinfo) { - atomic_long_dec(fsnotify_sb_watched_objects(sb)); + atomic_long_dec(&sbinfo->watched_objects[0]); } static void fsnotify_get_inode_ref(struct inode *inode) { ihold(inode); - fsnotify_get_sb_watched_objects(inode->i_sb); + fsnotify_get_sb_watched_objects(fsnotify_sb_info(inode->i_sb)); } static void fsnotify_put_inode_ref(struct inode *inode) @@ -160,7 +160,7 @@ static void fsnotify_put_inode_ref(struct inode *inode) struct super_block *sb = inode->i_sb; iput(inode); - fsnotify_put_sb_watched_objects(sb); + fsnotify_put_sb_watched_objects(fsnotify_sb_info(sb)); } /* @@ -169,8 +169,8 @@ static void fsnotify_put_inode_ref(struct inode *inode) */ static void fsnotify_update_sb_watchers(struct fsnotify_mark_connector *conn) { - struct super_block *sb = fsnotify_connector_sb(conn); - struct fsnotify_sb_info *sbinfo = fsnotify_sb_info(sb); + struct fsnotify_sb_info *sbinfo = + fsnotify_sb_info(fsnotify_connector_sb(conn)); bool is_watched = conn->flags & FSNOTIFY_CONN_FLAG_IS_WATCHED; struct fsnotify_mark *first_mark = NULL; unsigned int highest_prio = 0; @@ -198,10 +198,10 @@ static void fsnotify_update_sb_watchers(struct fsnotify_mark_connector *conn) BUILD_BUG_ON(FSNOTIFY_PRIO_NORMAL != 0); if (first_mark && !is_watched) { conn->flags |= FSNOTIFY_CONN_FLAG_IS_WATCHED; - fsnotify_get_sb_watched_objects(sb); + fsnotify_get_sb_watched_objects(sbinfo); } else if (!first_mark && is_watched) { conn->flags &= ~FSNOTIFY_CONN_FLAG_IS_WATCHED; - fsnotify_put_sb_watched_objects(sb); + fsnotify_put_sb_watched_objects(sbinfo); } } diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 41d913c328fa..bf6796be7561 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h @@ -586,11 +586,6 @@ static inline struct fsnotify_sb_info *fsnotify_sb_info(struct super_block *sb) #endif } -static inline atomic_long_t *fsnotify_sb_watched_objects(struct super_block *sb) -{ - return &fsnotify_sb_info(sb)->watched_objects[0]; -} - /* * A mark is simply an object attached to an in core inode which allows an * fsnotify listener to indicate they are either no longer interested in events -- 2.51.0