@@ -2309,7 +2309,7 @@ ext4_mb_regular_allocator(struct ext4_allocation_context *ac)
2309
2309
struct ext4_sb_info * sbi ;
2310
2310
struct super_block * sb ;
2311
2311
struct ext4_buddy e4b ;
2312
- unsigned int lost ;
2312
+ int lost ;
2313
2313
2314
2314
sb = ac -> ac_sb ;
2315
2315
sbi = EXT4_SB (sb );
@@ -2464,8 +2464,8 @@ ext4_mb_regular_allocator(struct ext4_allocation_context *ac)
2464
2464
* The only thing we can do is just take first
2465
2465
* found block(s)
2466
2466
*/
2467
- lost = ( unsigned int ) atomic_inc_return (& sbi -> s_mb_lost_chunks );
2468
- mb_debug (sb , "lost chunk, group: %u, start: %d, len: %d, lost: %u \n" ,
2467
+ lost = atomic_inc_return (& sbi -> s_mb_lost_chunks );
2468
+ mb_debug (sb , "lost chunk, group: %u, start: %d, len: %d, lost: %d \n" ,
2469
2469
ac -> ac_b_ex .fe_group , ac -> ac_b_ex .fe_start ,
2470
2470
ac -> ac_b_ex .fe_len , lost );
2471
2471
@@ -4706,20 +4706,19 @@ static int ext4_mb_release_context(struct ext4_allocation_context *ac)
4706
4706
pa -> pa_free -= ac -> ac_b_ex .fe_len ;
4707
4707
pa -> pa_len -= ac -> ac_b_ex .fe_len ;
4708
4708
spin_unlock (& pa -> pa_lock );
4709
- }
4710
- }
4711
- if (pa ) {
4712
- /*
4713
- * We want to add the pa to the right bucket.
4714
- * Remove it from the list and while adding
4715
- * make sure the list to which we are adding
4716
- * doesn't grow big.
4717
- */
4718
- if ((pa -> pa_type == MB_GROUP_PA ) && likely (pa -> pa_free )) {
4719
- spin_lock (pa -> pa_obj_lock );
4720
- list_del_rcu (& pa -> pa_inode_list );
4721
- spin_unlock (pa -> pa_obj_lock );
4722
- ext4_mb_add_n_trim (ac );
4709
+
4710
+ /*
4711
+ * We want to add the pa to the right bucket.
4712
+ * Remove it from the list and while adding
4713
+ * make sure the list to which we are adding
4714
+ * doesn't grow big.
4715
+ */
4716
+ if (likely (pa -> pa_free )) {
4717
+ spin_lock (pa -> pa_obj_lock );
4718
+ list_del_rcu (& pa -> pa_inode_list );
4719
+ spin_unlock (pa -> pa_obj_lock );
4720
+ ext4_mb_add_n_trim (ac );
4721
+ }
4723
4722
}
4724
4723
ext4_mb_put_pa (ac , ac -> ac_sb , pa );
4725
4724
}
0 commit comments