Skip to content

Commit b76808f

Browse files
Gui HechengChris Mason
authored andcommitted
btrfs: cleanup init for list in free-space-cache
o removed an unecessary INIT_LIST_HEAD after LIST_HEAD o merge a declare & INIT_LIST_HEAD pair into one LIST_HEAD Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> Reviewed-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
1 parent 2f08108 commit b76808f

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎fs/btrfs/free-space-cache.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -651,15 +651,13 @@ static int __load_free_space_cache(struct btrfs_root *root, struct inode *inode,
651651
struct io_ctl io_ctl;
652652
struct btrfs_key key;
653653
struct btrfs_free_space *e, *n;
654-
struct list_head bitmaps;
654+
LIST_HEAD(bitmaps);
655655
u64 num_entries;
656656
u64 num_bitmaps;
657657
u64 generation;
658658
u8 type;
659659
int ret = 0;
660660

661-
INIT_LIST_HEAD(&bitmaps);
662-
663661
/* Nothing in the space cache, goodbye */
664662
if (!i_size_read(inode))
665663
return 0;
@@ -2905,7 +2903,6 @@ int btrfs_find_space_cluster(struct btrfs_root *root,
29052903
trace_btrfs_find_cluster(block_group, offset, bytes, empty_size,
29062904
min_bytes);
29072905

2908-
INIT_LIST_HEAD(&bitmaps);
29092906
ret = setup_cluster_no_bitmap(block_group, cluster, &bitmaps, offset,
29102907
bytes + empty_size,
29112908
cont1_bytes, min_bytes);

0 commit comments

Comments
 (0)