]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
fs: remove useless plus one in super_cache_scan()
authorJinliang Zheng <alexjlzheng@tencent.com>
Mon, 28 Apr 2025 13:50:50 +0000 (21:50 +0800)
committerChristian Brauner <brauner@kernel.org>
Tue, 29 Apr 2025 11:08:29 +0000 (13:08 +0200)
After commit 475d0db742e3 ("fs: Fix theoretical division by 0 in
super_cache_scan()."), there's no need to plus one to prevent
division by zero.

Remove it to simplify the code.

Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Link: https://lore.kernel.org/20250428135050.267297-1-alexjlzheng@tencent.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/super.c

index 97a17f9d9023dc79e69ad852e610928aad479a0c..6bbdb7e59a8d22350b1c65772cb2846ad3964e12 100644 (file)
@@ -201,7 +201,7 @@ static unsigned long super_cache_scan(struct shrinker *shrink,
 
        inodes = list_lru_shrink_count(&sb->s_inode_lru, sc);
        dentries = list_lru_shrink_count(&sb->s_dentry_lru, sc);
-       total_objects = dentries + inodes + fs_objects + 1;
+       total_objects = dentries + inodes + fs_objects;
        if (!total_objects)
                total_objects = 1;