From: Theodore Ts'o Date: Mon, 23 Nov 2009 01:48:42 +0000 (-0500) Subject: ext4: use ext4_data_block_valid() in ext4_free_blocks() X-Git-Tag: MMI-PSA29.97-13-9~25696^2~19 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9084d4719784b00ff0bf9c9580007fac8277dbcb;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git ext4: use ext4_data_block_valid() in ext4_free_blocks() The block validity framework does a more comprehensive set of checks, and it saves object code space to use the ext4_data_block_valid() than the limited open-coded version that had been in ext4_free_blocks(). Signed-off-by: "Theodore Ts'o" --- diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 78de5d3c5dce..ab2dad1dfb7e 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -4463,9 +4463,7 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode, sbi = EXT4_SB(sb); es = EXT4_SB(sb)->s_es; - if (block < le32_to_cpu(es->s_first_data_block) || - block + count < block || - block + count > ext4_blocks_count(es)) { + if (!ext4_data_block_valid(sbi, block, count)) { ext4_error(sb, __func__, "Freeing blocks not in datazone - " "block = %llu, count = %lu", block, count);