Skip to content

Commit

Permalink
ext4: use ext4_data_block_valid() in ext4_free_blocks()
Browse files Browse the repository at this point in the history
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" <tytso@mit.edu>
  • Loading branch information
Theodore Ts'o committed Nov 23, 2009
1 parent 1585d8d commit 9084d47
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/ext4/mballoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9084d47

Please sign in to comment.