From f8fb4f415034baeed983ca2fb0f51bd74d7370b0 Mon Sep 17 00:00:00 2001 From: Dmitry Monakhov Date: Sat, 30 Aug 2014 23:50:56 -0400 Subject: ext4: use ext4_ext_next_allocated_block instead of mext_next_extent This allows us to make mext_next_extent static and potentially get rid of it. Signed-off-by: Dmitry Monakhov Signed-off-by: Theodore Ts'o --- fs/ext4/extents.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'fs/ext4/extents.c') diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 74292a71b384..1b768343ddf1 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -5304,7 +5304,7 @@ ext4_ext_shift_extents(struct inode *inode, handle_t *handle, struct ext4_ext_path *path; int ret = 0, depth; struct ext4_extent *extent; - ext4_lblk_t stop_block, current_block; + ext4_lblk_t stop_block; ext4_lblk_t ex_start, ex_end; /* Let path point to the last extent */ @@ -5365,17 +5365,15 @@ ext4_ext_shift_extents(struct inode *inode, handle_t *handle, (unsigned long) start); return -EIO; } - - current_block = le32_to_cpu(extent->ee_block); - if (start > current_block) { + if (start > le32_to_cpu(extent->ee_block)) { /* Hole, move to the next extent */ - ret = mext_next_extent(inode, path, &extent); - if (ret != 0) { + if (extent < EXT_LAST_EXTENT(path[depth].p_hdr)) { + path[depth].p_ext++; + } else { + start = ext4_ext_next_allocated_block(path); ext4_ext_drop_refs(path); kfree(path); - if (ret == 1) - ret = 0; - break; + continue; } } ret = ext4_ext_shift_path_extents(path, shift, inode, -- cgit v1.2.3-58-ga151