]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: avoid wasted extent cache lookup if !PUNCH_OUT_EXT
authorRobin Dong <hao.bigrat@gmail.com>
Mon, 18 Jul 2011 03:27:43 +0000 (23:27 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 18 Jul 2011 03:27:43 +0000 (23:27 -0400)
commit6d654e08d974cb3e9ec64db936dbc84862e03930
treee1e7f6ea3f4cd41ecc030f07a4a454141dd2e158
parente4ef0b5f8e46c4d8ece4a8710a726ab255a695f4
ext4: avoid wasted extent cache lookup if !PUNCH_OUT_EXT

This patch avoids an extraneous lookup of the extent cache
in ext4_ext_map_blocks() when the flag
EXT4_GET_BLOCKS_PUNCH_OUT_EXT is absent.

The existing logic was performing the lookup but not making
use of the result. The patch simply reverses the order of evaluation
in the condition.

Since ext4_ext_in_cache() does not initialize newex on misses, bypassing
its invocation does not introduce any new issue in this regard.

Signed-off-by: Robin Dong <sanbai@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Eric Gouriou <egouriou@google.com>
fs/ext4/extents.c