From 8e0f76ab0c9083b24e289ba2b19d0e4bd1655e14 Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Thu, 17 Apr 2008 10:38:59 -0400 Subject: [PATCH] --- yaml --- r: 95040 b: refs/heads/master c: d00a6d7b40b44ee6b03f492a6c58f5bc4649c784 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ext4/balloc.c | 6 +++--- trunk/fs/ext4/xattr.c | 6 ++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 1610c5d1bcd7..57f43bc999e4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 216c34b2b8a3687afed4d269acec140c8baf23fe +refs/heads/master: d00a6d7b40b44ee6b03f492a6c58f5bc4649c784 diff --git a/trunk/fs/ext4/balloc.c b/trunk/fs/ext4/balloc.c index 5d348998ff38..a080d7f5face 100644 --- a/trunk/fs/ext4/balloc.c +++ b/trunk/fs/ext4/balloc.c @@ -48,7 +48,6 @@ void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr, unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh, ext4_group_t block_group, struct ext4_group_desc *gdp) { - unsigned long start; int bit, bit_max; unsigned free_blocks, group_blocks; struct ext4_sb_info *sbi = EXT4_SB(sb); @@ -106,11 +105,12 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh, free_blocks = group_blocks - bit_max; if (bh) { + ext4_fsblk_t start; + for (bit = 0; bit < bit_max; bit++) ext4_set_bit(bit, bh->b_data); - start = block_group * EXT4_BLOCKS_PER_GROUP(sb) + - le32_to_cpu(sbi->s_es->s_first_data_block); + start = ext4_group_first_block_no(sb, block_group); /* Set bits for block and inode bitmaps, and inode table */ ext4_set_bit(ext4_block_bitmap(sb, gdp) - start, bh->b_data); diff --git a/trunk/fs/ext4/xattr.c b/trunk/fs/ext4/xattr.c index 726716b618d8..bc1d7daac8eb 100644 --- a/trunk/fs/ext4/xattr.c +++ b/trunk/fs/ext4/xattr.c @@ -806,10 +806,8 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode, get_bh(new_bh); } else { /* We need to allocate a new block */ - ext4_fsblk_t goal = le32_to_cpu( - EXT4_SB(sb)->s_es->s_first_data_block) + - (ext4_fsblk_t)EXT4_I(inode)->i_block_group * - EXT4_BLOCKS_PER_GROUP(sb); + ext4_fsblk_t goal = ext4_group_first_block_no(sb, + EXT4_I(inode)->i_block_group); ext4_fsblk_t block = ext4_new_block(handle, inode, goal, &error); if (error)