summaryrefslogtreecommitdiff
path: root/fs/ext4/extents.c
diff options
context:
space:
mode:
authorZheng Liu <wenqing.lz@taobao.com>2013-02-18 00:27:26 -0500
committerTheodore Ts'o <tytso@mit.edu>2013-02-18 00:27:26 -0500
commitbe401363ac5ec652c706263a59b0bd0acc3612e8 (patch)
tree64a7f85c2e1a0157a3ca740e4afc99260d8938c9 /fs/ext4/extents.c
parentfdc0212e86ca15c5cfed77088af7cc5eb79ccbc7 (diff)
ext4: rename and improbe ext4_es_find_extent()
This commit renames ext4_es_find_extent with ext4_es_find_delayed_extent and improve this function. First, we split input and output parameter. Second, this function never return the first block of the next delayed extent after 'es'. Signed-off-by: Zheng Liu <wenqing.lz@taobao.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Cc: Jan kara <jack@suse.cz>
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r--fs/ext4/extents.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 37f94a751ad7..895c19595ecf 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3528,8 +3528,7 @@ static int ext4_find_delalloc_range(struct inode *inode,
{
struct extent_status es;
- es.es_lblk = lblk_start;
- (void)ext4_es_find_extent(inode, &es);
+ ext4_es_find_delayed_extent(inode, lblk_start, &es);
if (es.es_len == 0)
return 0; /* there is no delay extent in this tree */
else if (es.es_lblk <= lblk_start &&
@@ -4568,10 +4567,9 @@ static int ext4_find_delayed_extent(struct inode *inode,
struct ext4_ext_cache *newex)
{
struct extent_status es;
- ext4_lblk_t next_del;
+ ext4_lblk_t block, next_del;
- es.es_lblk = newex->ec_block;
- next_del = ext4_es_find_extent(inode, &es);
+ ext4_es_find_delayed_extent(inode, newex->ec_block, &es);
if (newex->ec_start == 0) {
/*
@@ -4592,6 +4590,13 @@ static int ext4_find_delayed_extent(struct inode *inode,
newex->ec_len = es.es_lblk + es.es_len - newex->ec_block;
}
+ block = newex->ec_block + newex->ec_len;
+ ext4_es_find_delayed_extent(inode, block, &es);
+ if (es.es_len == 0)
+ next_del = EXT_MAX_BLOCKS;
+ else
+ next_del = es.es_lblk;
+
return next_del;
}
/* fiemap flags we can handle specified here */