aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorLukas Czerner <lczerner@redhat.com>2013-05-27 23:32:35 -0400
committerTheodore Ts'o <tytso@mit.edu>2013-05-27 23:32:35 -0400
commit78fb9cdf035d88a39a5e5f83bb8788e4fe7c1f72 (patch)
tree7f5feecf913163a790d468908c9696e2181f5a36 /fs/ext4
parentc121ffd013e5ab7c04414a5f0cb3604731775174 (diff)
ext4: remove unused code from ext4_remove_blocks()
The "head removal" branch in the condition is never used in any code path in ext4 since the function only caller ext4_ext_rm_leaf() will make sure that the extent is properly split before removing blocks. Note that there is a bug in this branch anyway. This commit removes the unused code completely and makes use of ext4_error() instead of printk if dubious range is provided. Signed-off-by: Lukas Czerner <lczerner@redhat.com> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/extents.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index bc0f1910b9cf..18c3f1a131b3 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2432,23 +2432,10 @@ static int ext4_remove_blocks(handle_t *handle, struct inode *inode,
2432 *partial_cluster = EXT4_B2C(sbi, pblk); 2432 *partial_cluster = EXT4_B2C(sbi, pblk);
2433 else 2433 else
2434 *partial_cluster = 0; 2434 *partial_cluster = 0;
2435 } else if (from == le32_to_cpu(ex->ee_block) 2435 } else
2436 && to <= le32_to_cpu(ex->ee_block) + ee_len - 1) { 2436 ext4_error(sbi->s_sb, "strange request: removal(2) "
2437 /* head removal */ 2437 "%u-%u from %u:%u\n",
2438 ext4_lblk_t num; 2438 from, to, le32_to_cpu(ex->ee_block), ee_len);
2439 ext4_fsblk_t start;
2440
2441 num = to - from;
2442 start = ext4_ext_pblock(ex);
2443
2444 ext_debug("free first %u blocks starting %llu\n", num, start);
2445 ext4_free_blocks(handle, inode, NULL, start, num, flags);
2446
2447 } else {
2448 printk(KERN_INFO "strange request: removal(2) "
2449 "%u-%u from %u:%u\n",
2450 from, to, le32_to_cpu(ex->ee_block), ee_len);
2451 }
2452 return 0; 2439 return 0;
2453} 2440}
2454 2441