Introduce a helper sb_inodes_empty() which is used to detect if the inodes list is empty. Signed-off-by: Huang Shijie --- fs/super.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/super.c b/fs/super.c index 9d4025213521..e25ded0bc9a2 100644 --- a/fs/super.c +++ b/fs/super.c @@ -710,6 +710,11 @@ void retire_super(struct super_block *sb) } EXPORT_SYMBOL(retire_super); +static bool sb_inodes_empty(struct super_block *sb) +{ + return list_empty(&sb->s_inodes); +} + /** * generic_shutdown_super - common helper for ->kill_sb() * @sb: superblock to kill @@ -760,7 +765,7 @@ void generic_shutdown_super(struct super_block *sb) */ fscrypt_destroy_keyring(sb); - if (CHECK_DATA_CORRUPTION(!list_empty(&sb->s_inodes), NULL, + if (CHECK_DATA_CORRUPTION(!sb_inodes_empty(sb), NULL, "VFS: Busy inodes after unmount of %s (%s)", sb->s_id, sb->s_type->name)) { /* -- 2.53.0