@@ -112,7 +112,7 @@ static unsigned long super_cache_scan(struct shrinker *shrink,
112112 if (!(sc -> gfp_mask & __GFP_FS ))
113113 return SHRINK_STOP ;
114114
115- if (!trylock_super (sb ))
115+ if (!super_trylock_shared (sb ))
116116 return SHRINK_STOP ;
117117
118118 if (sb -> s_op -> nr_cached_objects )
@@ -159,17 +159,17 @@ static unsigned long super_cache_count(struct shrinker *shrink,
159159 sb = container_of (shrink , struct super_block , s_shrink );
160160
161161 /*
162- * We don't call trylock_super () here as it is a scalability bottleneck,
163- * so we're exposed to partial setup state. The shrinker rwsem does not
164- * protect filesystem operations backing list_lru_shrink_count() or
165- * s_op->nr_cached_objects(). Counts can change between
166- * super_cache_count and super_cache_scan, so we really don't need locks
167- * here.
162+ * We don't call super_trylock_shared () here as it is a scalability
163+ * bottleneck, so we're exposed to partial setup state. The shrinker
164+ * rwsem does not protect filesystem operations backing
165+ * list_lru_shrink_count() or s_op->nr_cached_objects(). Counts can
166+ * change between super_cache_count and super_cache_scan, so we really
167+ * don't need locks here.
168168 *
169169 * However, if we are currently mounting the superblock, the underlying
170170 * filesystem might be in a state of partial construction and hence it
171- * is dangerous to access it. trylock_super () uses a SB_BORN check to
172- * avoid this situation, so do the same here. The memory barrier is
171+ * is dangerous to access it. super_trylock_shared () uses a SB_BORN check
172+ * to avoid this situation, so do the same here. The memory barrier is
173173 * matched with the one in mount_fs() as we don't hold locks here.
174174 */
175175 if (!(sb -> s_flags & SB_BORN ))
@@ -428,7 +428,7 @@ static int grab_super(struct super_block *s) __releases(sb_lock)
428428}
429429
430430/*
431- * trylock_super - try to grab ->s_umount shared
431+ * super_trylock_shared - try to grab ->s_umount shared
432432 * @sb: reference we are trying to grab
433433 *
434434 * Try to prevent fs shutdown. This is used in places where we
@@ -444,7 +444,7 @@ static int grab_super(struct super_block *s) __releases(sb_lock)
444444 * of down_read(). There's a couple of places that are OK with that, but
445445 * it's very much not a general-purpose interface.
446446 */
447- bool trylock_super (struct super_block * sb )
447+ bool super_trylock_shared (struct super_block * sb )
448448{
449449 if (down_read_trylock (& sb -> s_umount )) {
450450 if (!hlist_unhashed (& sb -> s_instances ) &&
@@ -1210,7 +1210,7 @@ EXPORT_SYMBOL(get_tree_keyed);
12101210 * and the place that clears the pointer to the superblock used by this function
12111211 * before freeing the superblock.
12121212 */
1213- static bool lock_active_super (struct super_block * sb )
1213+ static bool super_lock_shared_active (struct super_block * sb )
12141214{
12151215 super_lock_shared (sb );
12161216 if (!sb -> s_root ||
@@ -1228,7 +1228,7 @@ static void fs_bdev_mark_dead(struct block_device *bdev, bool surprise)
12281228 /* bd_holder_lock ensures that the sb isn't freed */
12291229 lockdep_assert_held (& bdev -> bd_holder_lock );
12301230
1231- if (!lock_active_super (sb ))
1231+ if (!super_lock_shared_active (sb ))
12321232 return ;
12331233
12341234 if (!surprise )
@@ -1247,7 +1247,7 @@ static void fs_bdev_sync(struct block_device *bdev)
12471247
12481248 lockdep_assert_held (& bdev -> bd_holder_lock );
12491249
1250- if (!lock_active_super (sb ))
1250+ if (!super_lock_shared_active (sb ))
12511251 return ;
12521252 sync_filesystem (sb );
12531253 super_unlock_shared (sb );
0 commit comments