]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: simplify list initialization in btrfs_compr_pool_scan()
authorBaolin Liu <liubaolin@kylinos.cn>
Tue, 11 Nov 2025 12:05:58 +0000 (20:05 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Nov 2025 21:42:22 +0000 (22:42 +0100)
In btrfs_compr_pool_scan(), use LIST_HEAD() to declare and initialize
the 'remove' list_head in one step instead of using INIT_LIST_HEAD()
separately.

Signed-off-by: Baolin Liu <liubaolin@kylinos.cn>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/compression.c

index cdb5c891b0acf94e18b9c86dfe3b114b3b3ac77a..241a117ad7cc4b2187122c95545cd2501dc9255a 100644 (file)
@@ -192,15 +192,13 @@ static unsigned long btrfs_compr_pool_count(struct shrinker *sh, struct shrink_c
 
 static unsigned long btrfs_compr_pool_scan(struct shrinker *sh, struct shrink_control *sc)
 {
-       struct list_head remove;
+       LIST_HEAD(remove);
        struct list_head *tmp, *next;
        int freed;
 
        if (compr_pool.count == 0)
                return SHRINK_STOP;
 
-       INIT_LIST_HEAD(&remove);
-
        /* For now, just simply drain the whole list. */
        spin_lock(&compr_pool.lock);
        list_splice_init(&compr_pool.list, &remove);