提交 598dbdf2 编写于 作者: R Robin Dong 提交者: Theodore Ts'o

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: NRobin Dong <sanbai@taobao.com>
Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
上级 ffb505ff
...@@ -1730,9 +1730,10 @@ int ext4_ext_insert_extent(handle_t *handle, struct inode *inode, ...@@ -1730,9 +1730,10 @@ int ext4_ext_insert_extent(handle_t *handle, struct inode *inode,
/* probably next leaf has space for us? */ /* probably next leaf has space for us? */
fex = EXT_LAST_EXTENT(eh); fex = EXT_LAST_EXTENT(eh);
next = EXT_MAX_BLOCKS;
if (le32_to_cpu(newext->ee_block) > le32_to_cpu(fex->ee_block))
next = ext4_ext_next_leaf_block(inode, path); next = ext4_ext_next_leaf_block(inode, path);
if (le32_to_cpu(newext->ee_block) > le32_to_cpu(fex->ee_block) if (next != EXT_MAX_BLOCKS) {
&& next != EXT_MAX_BLOCKS) {
ext_debug("next leaf block - %d\n", next); ext_debug("next leaf block - %d\n", next);
BUG_ON(npath != NULL); BUG_ON(npath != NULL);
npath = ext4_ext_find_extent(inode, next, NULL); npath = ext4_ext_find_extent(inode, next, NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册