@@ -453,9 +453,9 @@ int bch2_trigger_stripe(struct btree_trans *trans,
453453 if (new_s ) {
454454 s64 sectors = (u64 ) le16_to_cpu (new_s -> sectors ) * new_s -> nr_redundant ;
455455
456- struct disk_accounting_pos acc = {
457- . type = BCH_DISK_ACCOUNTING_replicas ,
458- } ;
456+ struct disk_accounting_pos acc ;
457+ memset ( & acc , 0 , sizeof ( acc ));
458+ acc . type = BCH_DISK_ACCOUNTING_replicas ;
459459 bch2_bkey_to_replicas (& acc .replicas , new );
460460 int ret = bch2_disk_accounting_mod (trans , & acc , & sectors , 1 , gc );
461461 if (ret )
@@ -468,9 +468,9 @@ int bch2_trigger_stripe(struct btree_trans *trans,
468468 if (old_s ) {
469469 s64 sectors = - ((s64 ) le16_to_cpu (old_s -> sectors )) * old_s -> nr_redundant ;
470470
471- struct disk_accounting_pos acc = {
472- . type = BCH_DISK_ACCOUNTING_replicas ,
473- } ;
471+ struct disk_accounting_pos acc ;
472+ memset ( & acc , 0 , sizeof ( acc ));
473+ acc . type = BCH_DISK_ACCOUNTING_replicas ;
474474 bch2_bkey_to_replicas (& acc .replicas , old );
475475 int ret = bch2_disk_accounting_mod (trans , & acc , & sectors , 1 , gc );
476476 if (ret )
@@ -2110,14 +2110,14 @@ static int bch2_invalidate_stripe_to_dev(struct btree_trans *trans, struct bkey_
21102110 if (ret )
21112111 return ret ;
21122112
2113- struct disk_accounting_pos acc = {
2114- .type = BCH_DISK_ACCOUNTING_replicas ,
2115- };
2113+ struct disk_accounting_pos acc ;
21162114
21172115 s64 sectors = 0 ;
21182116 for (unsigned i = 0 ; i < s -> v .nr_blocks ; i ++ )
21192117 sectors -= stripe_blockcount_get (& s -> v , i );
21202118
2119+ memset (& acc , 0 , sizeof (acc ));
2120+ acc .type = BCH_DISK_ACCOUNTING_replicas ;
21212121 bch2_bkey_to_replicas (& acc .replicas , bkey_i_to_s_c (& s -> k_i ));
21222122 acc .replicas .data_type = BCH_DATA_user ;
21232123 ret = bch2_disk_accounting_mod (trans , & acc , & sectors , 1 , false);
@@ -2131,6 +2131,8 @@ static int bch2_invalidate_stripe_to_dev(struct btree_trans *trans, struct bkey_
21312131
21322132 sectors = - sectors ;
21332133
2134+ memset (& acc , 0 , sizeof (acc ));
2135+ acc .type = BCH_DISK_ACCOUNTING_replicas ;
21342136 bch2_bkey_to_replicas (& acc .replicas , bkey_i_to_s_c (& s -> k_i ));
21352137 acc .replicas .data_type = BCH_DATA_user ;
21362138 ret = bch2_disk_accounting_mod (trans , & acc , & sectors , 1 , false);
0 commit comments