Skip to content

Commit f69241d

Browse files
murphy12138kdave
authored andcommitted
btrfs: simplify list initialization in btrfs_compr_pool_scan()
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>
1 parent 09f7618 commit f69241d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/btrfs/compression.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,13 @@ static unsigned long btrfs_compr_pool_count(struct shrinker *sh, struct shrink_c
192192

193193
static unsigned long btrfs_compr_pool_scan(struct shrinker *sh, struct shrink_control *sc)
194194
{
195-
struct list_head remove;
195+
LIST_HEAD(remove);
196196
struct list_head *tmp, *next;
197197
int freed;
198198

199199
if (compr_pool.count == 0)
200200
return SHRINK_STOP;
201201

202-
INIT_LIST_HEAD(&remove);
203-
204202
/* For now, just simply drain the whole list. */
205203
spin_lock(&compr_pool.lock);
206204
list_splice_init(&compr_pool.list, &remove);

0 commit comments

Comments
 (0)