aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/mballoc.c
diff options
context:
space:
mode:
authorYongqiang Yang <xiaoqiangnk@gmail.com>2011-07-26 22:05:53 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-07-26 22:05:53 -0400
commitc3e94d1df9bdd9e2c4ba7e8f534f7925f1756f97 (patch)
treeb0f23df82b491e04b64d7d67e4eecc80d1f4c6a0 /fs/ext4/mballoc.c
parent2b79b09d13e35577151bd13ba08809911baccd1c (diff)
ext4: let setup_new_group_blocks() set multiple bits at a time
Rename mb_set_bits() to ext4_set_bits() and make it a global function so that setup_new_group_blocks() can use it. Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r--fs/ext4/mballoc.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index b6ef4da39ce3..fa716c9b2455 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -1282,7 +1282,7 @@ static void mb_clear_bits(void *bm, int cur, int len)
1282 } 1282 }
1283} 1283}
1284 1284
1285static void mb_set_bits(void *bm, int cur, int len) 1285void ext4_set_bits(void *bm, int cur, int len)
1286{ 1286{
1287 __u32 *addr; 1287 __u32 *addr;
1288 1288
@@ -1511,7 +1511,7 @@ static int mb_mark_used(struct ext4_buddy *e4b, struct ext4_free_extent *ex)
1511 } 1511 }
1512 mb_set_largest_free_order(e4b->bd_sb, e4b->bd_info); 1512 mb_set_largest_free_order(e4b->bd_sb, e4b->bd_info);
1513 1513
1514 mb_set_bits(EXT4_MB_BITMAP(e4b), ex->fe_start, len0); 1514 ext4_set_bits(EXT4_MB_BITMAP(e4b), ex->fe_start, len0);
1515 mb_check_buddy(e4b); 1515 mb_check_buddy(e4b);
1516 1516
1517 return ret; 1517 return ret;
@@ -2795,8 +2795,8 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
2795 * We leak some of the blocks here. 2795 * We leak some of the blocks here.
2796 */ 2796 */
2797 ext4_lock_group(sb, ac->ac_b_ex.fe_group); 2797 ext4_lock_group(sb, ac->ac_b_ex.fe_group);
2798 mb_set_bits(bitmap_bh->b_data, ac->ac_b_ex.fe_start, 2798 ext4_set_bits(bitmap_bh->b_data, ac->ac_b_ex.fe_start,
2799 ac->ac_b_ex.fe_len); 2799 ac->ac_b_ex.fe_len);
2800 ext4_unlock_group(sb, ac->ac_b_ex.fe_group); 2800 ext4_unlock_group(sb, ac->ac_b_ex.fe_group);
2801 err = ext4_handle_dirty_metadata(handle, NULL, bitmap_bh); 2801 err = ext4_handle_dirty_metadata(handle, NULL, bitmap_bh);
2802 if (!err) 2802 if (!err)
@@ -2814,7 +2814,8 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
2814 } 2814 }
2815 } 2815 }
2816#endif 2816#endif
2817 mb_set_bits(bitmap_bh->b_data, ac->ac_b_ex.fe_start,ac->ac_b_ex.fe_len); 2817 ext4_set_bits(bitmap_bh->b_data, ac->ac_b_ex.fe_start,
2818 ac->ac_b_ex.fe_len);
2818 if (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) { 2819 if (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {
2819 gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT); 2820 gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT);
2820 ext4_free_blks_set(sb, gdp, 2821 ext4_free_blks_set(sb, gdp,
@@ -3284,7 +3285,7 @@ static void ext4_mb_generate_from_freelist(struct super_block *sb, void *bitmap,
3284 3285
3285 while (n) { 3286 while (n) {
3286 entry = rb_entry(n, struct ext4_free_data, node); 3287 entry = rb_entry(n, struct ext4_free_data, node);
3287 mb_set_bits(bitmap, entry->start_blk, entry->count); 3288 ext4_set_bits(bitmap, entry->start_blk, entry->count);
3288 n = rb_next(n); 3289 n = rb_next(n);
3289 } 3290 }
3290 return; 3291 return;
@@ -3326,7 +3327,7 @@ void ext4_mb_generate_from_pa(struct super_block *sb, void *bitmap,
3326 if (unlikely(len == 0)) 3327 if (unlikely(len == 0))
3327 continue; 3328 continue;
3328 BUG_ON(groupnr != group); 3329 BUG_ON(groupnr != group);
3329 mb_set_bits(bitmap, start, len); 3330 ext4_set_bits(bitmap, start, len);
3330 preallocated += len; 3331 preallocated += len;
3331 count++; 3332 count++;
3332 } 3333 }