@@ -3504,11 +3504,10 @@ static void ext4_discard_work(struct work_struct *work)
3504
3504
struct super_block * sb = sbi -> s_sb ;
3505
3505
struct ext4_free_data * fd , * nfd ;
3506
3506
struct ext4_buddy e4b ;
3507
- struct list_head discard_list ;
3507
+ LIST_HEAD ( discard_list ) ;
3508
3508
ext4_group_t grp , load_grp ;
3509
3509
int err = 0 ;
3510
3510
3511
- INIT_LIST_HEAD (& discard_list );
3512
3511
spin_lock (& sbi -> s_md_lock );
3513
3512
list_splice_init (& sbi -> s_discard_list , & discard_list );
3514
3513
spin_unlock (& sbi -> s_md_lock );
@@ -3882,12 +3881,10 @@ void ext4_process_freed_data(struct super_block *sb, tid_t commit_tid)
3882
3881
{
3883
3882
struct ext4_sb_info * sbi = EXT4_SB (sb );
3884
3883
struct ext4_free_data * entry , * tmp ;
3885
- struct list_head freed_data_list ;
3884
+ LIST_HEAD ( freed_data_list ) ;
3886
3885
struct list_head * cut_pos = NULL ;
3887
3886
bool wake ;
3888
3887
3889
- INIT_LIST_HEAD (& freed_data_list );
3890
-
3891
3888
spin_lock (& sbi -> s_md_lock );
3892
3889
list_for_each_entry (entry , & sbi -> s_freed_data_list , efd_list ) {
3893
3890
if (entry -> efd_tid != commit_tid )
@@ -5414,7 +5411,7 @@ ext4_mb_discard_group_preallocations(struct super_block *sb,
5414
5411
struct ext4_group_info * grp = ext4_get_group_info (sb , group );
5415
5412
struct buffer_head * bitmap_bh = NULL ;
5416
5413
struct ext4_prealloc_space * pa , * tmp ;
5417
- struct list_head list ;
5414
+ LIST_HEAD ( list ) ;
5418
5415
struct ext4_buddy e4b ;
5419
5416
struct ext4_inode_info * ei ;
5420
5417
int err ;
@@ -5443,7 +5440,6 @@ ext4_mb_discard_group_preallocations(struct super_block *sb,
5443
5440
goto out_dbg ;
5444
5441
}
5445
5442
5446
- INIT_LIST_HEAD (& list );
5447
5443
ext4_lock_group (sb , group );
5448
5444
list_for_each_entry_safe (pa , tmp ,
5449
5445
& grp -> bb_prealloc_list , pa_group_list ) {
@@ -5524,7 +5520,7 @@ void ext4_discard_preallocations(struct inode *inode, unsigned int needed)
5524
5520
struct buffer_head * bitmap_bh = NULL ;
5525
5521
struct ext4_prealloc_space * pa , * tmp ;
5526
5522
ext4_group_t group = 0 ;
5527
- struct list_head list ;
5523
+ LIST_HEAD ( list ) ;
5528
5524
struct ext4_buddy e4b ;
5529
5525
struct rb_node * iter ;
5530
5526
int err ;
@@ -5541,8 +5537,6 @@ void ext4_discard_preallocations(struct inode *inode, unsigned int needed)
5541
5537
trace_ext4_discard_preallocations (inode ,
5542
5538
atomic_read (& ei -> i_prealloc_active ), needed );
5543
5539
5544
- INIT_LIST_HEAD (& list );
5545
-
5546
5540
if (needed == 0 )
5547
5541
needed = UINT_MAX ;
5548
5542
@@ -5858,13 +5852,11 @@ ext4_mb_discard_lg_preallocations(struct super_block *sb,
5858
5852
{
5859
5853
ext4_group_t group = 0 ;
5860
5854
struct ext4_buddy e4b ;
5861
- struct list_head discard_list ;
5855
+ LIST_HEAD ( discard_list ) ;
5862
5856
struct ext4_prealloc_space * pa , * tmp ;
5863
5857
5864
5858
mb_debug (sb , "discard locality group preallocation\n" );
5865
5859
5866
- INIT_LIST_HEAD (& discard_list );
5867
-
5868
5860
spin_lock (& lg -> lg_prealloc_lock );
5869
5861
list_for_each_entry_rcu (pa , & lg -> lg_prealloc_list [order ],
5870
5862
pa_node .lg_list ,
0 commit comments