mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
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>
This commit is contained in:
parent
07166122b5
commit
9b3743a676
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user