diff options
author | Robin Dong <sanbai@taobao.com> | 2011-07-11 18:24:01 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-07-11 18:24:01 -0400 |
commit | 598dbdf2433cad55bd44d923f67a053871e3eabf (patch) | |
tree | 848036d87de48e271f6e23c1603100f4a75a2387 /fs/ext4/extents.c | |
parent | ffb505ff0f7b52318dea46dd139107a8371b4ad7 (diff) |
ext4: avoid unneeded ext4_ext_next_leaf_block() while inserting extents
Optimize ext4_ext_insert_extent() by avoiding
ext4_ext_next_leaf_block() when the result is not used/needed.
Signed-off-by: Robin Dong <sanbai@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r-- | fs/ext4/extents.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 9cbdcb2110f5..f1c538e5055c 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -1730,9 +1730,10 @@ int ext4_ext_insert_extent(handle_t *handle, struct inode *inode, | |||
1730 | 1730 | ||
1731 | /* probably next leaf has space for us? */ | 1731 | /* probably next leaf has space for us? */ |
1732 | fex = EXT_LAST_EXTENT(eh); | 1732 | fex = EXT_LAST_EXTENT(eh); |
1733 | next = ext4_ext_next_leaf_block(inode, path); | 1733 | next = EXT_MAX_BLOCKS; |
1734 | if (le32_to_cpu(newext->ee_block) > le32_to_cpu(fex->ee_block) | 1734 | if (le32_to_cpu(newext->ee_block) > le32_to_cpu(fex->ee_block)) |
1735 | && next != EXT_MAX_BLOCKS) { | 1735 | next = ext4_ext_next_leaf_block(inode, path); |
1736 | if (next != EXT_MAX_BLOCKS) { | ||
1736 | ext_debug("next leaf block - %d\n", next); | 1737 | ext_debug("next leaf block - %d\n", next); |
1737 | BUG_ON(npath != NULL); | 1738 | BUG_ON(npath != NULL); |
1738 | npath = ext4_ext_find_extent(inode, next, NULL); | 1739 | npath = ext4_ext_find_extent(inode, next, NULL); |