File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -1302,12 +1302,6 @@ struct super_block {
1302
1302
/* Number of inodes with nlink == 0 but still referenced */
1303
1303
atomic_long_t s_remove_count ;
1304
1304
1305
- /*
1306
- * Number of inode/mount/sb objects that are being watched, note that
1307
- * inodes objects are currently double-accounted.
1308
- */
1309
- atomic_long_t s_fsnotify_connectors ;
1310
-
1311
1305
/* Read-only state of the superblock is being changed */
1312
1306
int s_readonly_remount ;
1313
1307
Original file line number Diff line number Diff line change 20
20
/* Are there any inode/mount/sb objects that are being watched at all? */
21
21
static inline bool fsnotify_sb_has_watchers (struct super_block * sb )
22
22
{
23
- return atomic_long_read (fsnotify_sb_watched_objects (sb ));
23
+ struct fsnotify_sb_info * sbinfo = fsnotify_sb_info (sb );
24
+
25
+ /* Were any marks ever added to any object on this sb? */
26
+ if (!sbinfo )
27
+ return false;
28
+
29
+ return atomic_long_read (& sbinfo -> watched_objects );
24
30
}
25
31
26
32
/*
Original file line number Diff line number Diff line change @@ -483,6 +483,11 @@ struct fsnotify_mark_connector {
483
483
*/
484
484
struct fsnotify_sb_info {
485
485
struct fsnotify_mark_connector __rcu * sb_marks ;
486
+ /*
487
+ * Number of inode/mount/sb objects that are being watched in this sb.
488
+ * Note that inodes objects are currently double-accounted.
489
+ */
490
+ atomic_long_t watched_objects ;
486
491
};
487
492
488
493
static inline struct fsnotify_sb_info * fsnotify_sb_info (struct super_block * sb )
@@ -496,7 +501,7 @@ static inline struct fsnotify_sb_info *fsnotify_sb_info(struct super_block *sb)
496
501
497
502
static inline atomic_long_t * fsnotify_sb_watched_objects (struct super_block * sb )
498
503
{
499
- return & sb -> s_fsnotify_connectors ;
504
+ return & fsnotify_sb_info ( sb ) -> watched_objects ;
500
505
}
501
506
502
507
/*
You can’t perform that action at this time.
0 commit comments