diff options
author | Zheng Liu <wenqing.lz@taobao.com> | 2013-02-18 00:27:26 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-02-18 00:27:26 -0500 |
commit | be401363ac5ec652c706263a59b0bd0acc3612e8 (patch) | |
tree | 64a7f85c2e1a0157a3ca740e4afc99260d8938c9 /fs/ext4/extents.c | |
parent | fdc0212e86ca15c5cfed77088af7cc5eb79ccbc7 (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.c | 15 |
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, | |||
3528 | { | 3528 | { |
3529 | struct extent_status es; | 3529 | struct extent_status es; |
3530 | 3530 | ||
3531 | es.es_lblk = lblk_start; | 3531 | ext4_es_find_delayed_extent(inode, lblk_start, &es); |
3532 | (void)ext4_es_find_extent(inode, &es); | ||
3533 | if (es.es_len == 0) | 3532 | if (es.es_len == 0) |
3534 | return 0; /* there is no delay extent in this tree */ | 3533 | return 0; /* there is no delay extent in this tree */ |
3535 | else if (es.es_lblk <= lblk_start && | 3534 | else if (es.es_lblk <= lblk_start && |
@@ -4568,10 +4567,9 @@ static int ext4_find_delayed_extent(struct inode *inode, | |||
4568 | struct ext4_ext_cache *newex) | 4567 | struct ext4_ext_cache *newex) |
4569 | { | 4568 | { |
4570 | struct extent_status es; | 4569 | struct extent_status es; |
4571 | ext4_lblk_t next_del; | 4570 | ext4_lblk_t block, next_del; |
4572 | 4571 | ||
4573 | es.es_lblk = newex->ec_block; | 4572 | ext4_es_find_delayed_extent(inode, newex->ec_block, &es); |
4574 | next_del = ext4_es_find_extent(inode, &es); | ||
4575 | 4573 | ||
4576 | if (newex->ec_start == 0) { | 4574 | if (newex->ec_start == 0) { |
4577 | /* | 4575 | /* |
@@ -4592,6 +4590,13 @@ static int ext4_find_delayed_extent(struct inode *inode, | |||
4592 | newex->ec_len = es.es_lblk + es.es_len - newex->ec_block; | 4590 | newex->ec_len = es.es_lblk + es.es_len - newex->ec_block; |
4593 | } | 4591 | } |
4594 | 4592 | ||
4593 | block = newex->ec_block + newex->ec_len; | ||
4594 | ext4_es_find_delayed_extent(inode, block, &es); | ||
4595 | if (es.es_len == 0) | ||
4596 | next_del = EXT_MAX_BLOCKS; | ||
4597 | else | ||
4598 | next_del = es.es_lblk; | ||
4599 | |||
4595 | return next_del; | 4600 | return next_del; |
4596 | } | 4601 | } |
4597 | /* fiemap flags we can handle specified here */ | 4602 | /* fiemap flags we can handle specified here */ |