summaryrefslogtreecommitdiff
path: root/fs/ext4/extents.c
diff options
context:
space:
mode:
authorDmitry Monakhov <dmonakhov@openvz.org>2014-08-31 07:50:56 +0400
committerTheodore Ts'o <tytso@mit.edu>2014-08-31 07:50:56 +0400
commitf8fb4f415034baeed983ca2fb0f51bd74d7370b0 (patch)
tree8c3c0795608c995d0da536db2c47ae9742b0d39b /fs/ext4/extents.c
parentee124d2746250786b306952bb8955d3171fa8e69 (diff)
downloadlinux-f8fb4f415034baeed983ca2fb0f51bd74d7370b0.tar.xz
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 <dmonakhov@openvz.org> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r--fs/ext4/extents.c16
1 files changed, 7 insertions, 9 deletions
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,