diff options
author | Theodore Ts'o <tytso@mit.edu> | 2009-11-22 20:48:42 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-11-22 20:48:42 -0500 |
commit | 9084d4719784b00ff0bf9c9580007fac8277dbcb (patch) | |
tree | b929aefb4a1a57111de33f6745db95e9c0407fff /fs/ext4/mballoc.c | |
parent | 1585d8d89ae1791d8f957731f5655700fbcc5664 (diff) |
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" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r-- | fs/ext4/mballoc.c | 4 |
1 files changed, 1 insertions, 3 deletions
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, | |||
4463 | 4463 | ||
4464 | sbi = EXT4_SB(sb); | 4464 | sbi = EXT4_SB(sb); |
4465 | es = EXT4_SB(sb)->s_es; | 4465 | es = EXT4_SB(sb)->s_es; |
4466 | if (block < le32_to_cpu(es->s_first_data_block) || | 4466 | if (!ext4_data_block_valid(sbi, block, count)) { |
4467 | block + count < block || | ||
4468 | block + count > ext4_blocks_count(es)) { | ||
4469 | ext4_error(sb, __func__, | 4467 | ext4_error(sb, __func__, |
4470 | "Freeing blocks not in datazone - " | 4468 | "Freeing blocks not in datazone - " |
4471 | "block = %llu, count = %lu", block, count); | 4469 | "block = %llu, count = %lu", block, count); |