From: Jinliang Zheng Date: Mon, 28 Apr 2025 13:50:50 +0000 (+0800) Subject: fs: remove useless plus one in super_cache_scan() X-Git-Tag: v6.16-rc1~223^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f81d707022c244c1930cc6da9f026d0f8acab6c;p=thirdparty%2Fkernel%2Flinux.git fs: remove useless plus one in super_cache_scan() 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 Link: https://lore.kernel.org/20250428135050.267297-1-alexjlzheng@tencent.com Reviewed-by: Jan Kara Signed-off-by: Christian Brauner --- diff --git a/fs/super.c b/fs/super.c index 97a17f9d9023d..6bbdb7e59a8d2 100644 --- a/fs/super.c +++ b/fs/super.c @@ -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;