diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2010-03-03 23:53:25 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-03-03 23:53:25 -0500 |
commit | bda00de7e8569b1fcde27b68fa59e74e14c5f93a (patch) | |
tree | a27ac13a211b9adc56621ca28e2f801c33304788 /fs/ext4/mballoc.c | |
parent | 5661bd6861b7490394e29aaf74dca812188272e4 (diff) | |
download | op-kernel-dev-bda00de7e8569b1fcde27b68fa59e74e14c5f93a.zip op-kernel-dev-bda00de7e8569b1fcde27b68fa59e74e14c5f93a.tar.gz |
ext4: cleanup to use ext4_grp_offs_to_block()
More cleanup to convert open-coded calculations of the first block
number of a free extent to use ext4_grp_offs_to_block() instead.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger@sun.com>
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r-- | fs/ext4/mballoc.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 1156869..37d2438 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -2697,9 +2697,7 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac, if (err) goto out_err; - block = ac->ac_b_ex.fe_group * EXT4_BLOCKS_PER_GROUP(sb) - + ac->ac_b_ex.fe_start - + le32_to_cpu(es->s_first_data_block); + block = ext4_grp_offs_to_block(sb, &ac->ac_b_ex); len = ac->ac_b_ex.fe_len; if (!ext4_data_block_valid(sbi, block, len)) { @@ -3154,9 +3152,7 @@ ext4_mb_use_preallocated(struct ext4_allocation_context *ac) /* The max size of hash table is PREALLOC_TB_SIZE */ order = PREALLOC_TB_SIZE - 1; - goal_block = ac->ac_g_ex.fe_group * EXT4_BLOCKS_PER_GROUP(ac->ac_sb) + - ac->ac_g_ex.fe_start + - le32_to_cpu(EXT4_SB(ac->ac_sb)->s_es->s_first_data_block); + goal_block = ext4_grp_offs_to_block(ac->ac_sb, &ac->ac_g_ex); /* * search for the prealloc space that is having * minimal distance from the goal block. |