aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ext4/mballoc.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index cda69632eea3..d559a03f3eb2 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -1070,7 +1070,10 @@ static void mb_clear_bits(spinlock_t *lock, void *bm, int cur, int len)
1070 cur += 32; 1070 cur += 32;
1071 continue; 1071 continue;
1072 } 1072 }
1073 mb_clear_bit_atomic(lock, cur, bm); 1073 if (lock)
1074 mb_clear_bit_atomic(lock, cur, bm);
1075 else
1076 mb_clear_bit(cur, bm);
1074 cur++; 1077 cur++;
1075 } 1078 }
1076} 1079}
@@ -1088,7 +1091,10 @@ static void mb_set_bits(spinlock_t *lock, void *bm, int cur, int len)
1088 cur += 32; 1091 cur += 32;
1089 continue; 1092 continue;
1090 } 1093 }
1091 mb_set_bit_atomic(lock, cur, bm); 1094 if (lock)
1095 mb_set_bit_atomic(lock, cur, bm);
1096 else
1097 mb_set_bit(cur, bm);
1092 cur++; 1098 cur++;
1093 } 1099 }
1094} 1100}
@@ -3035,10 +3041,9 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
3035 } 3041 }
3036 } 3042 }
3037#endif 3043#endif
3038 mb_set_bits(sb_bgl_lock(sbi, ac->ac_b_ex.fe_group), bitmap_bh->b_data,
3039 ac->ac_b_ex.fe_start, ac->ac_b_ex.fe_len);
3040
3041 spin_lock(sb_bgl_lock(sbi, ac->ac_b_ex.fe_group)); 3044 spin_lock(sb_bgl_lock(sbi, ac->ac_b_ex.fe_group));
3045 mb_set_bits(NULL, bitmap_bh->b_data,
3046 ac->ac_b_ex.fe_start, ac->ac_b_ex.fe_len);
3042 if (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) { 3047 if (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {
3043 gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT); 3048 gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT);
3044 gdp->bg_free_blocks_count = 3049 gdp->bg_free_blocks_count =