diff options
author | Tiezhu Yang <kernelpatch@126.com> | 2015-07-17 04:56:00 (GMT) |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-08-05 15:08:10 (GMT) |
commit | 737f18992ee81cab897336e84c5c7f4e179dfd61 (patch) | |
tree | 161ed9461b87bf7674218a6f92c37de24b87dd90 /fs/f2fs | |
parent | 55f57d2c4259a9a4048cf4629a2c6ba53729188d (diff) | |
download | linux-737f18992ee81cab897336e84c5c7f4e179dfd61.tar.xz |
f2fs: optimize f2fs_write_cache_pages
The if statement "goto continue_unlock" is exactly the same when
each if condition is true that is depended on the value of both
"step" and "is_cold_data(page)" are 0 or 1. That means when the
value of "step" equals to "is_cold_data(page)", the if condition
is true and the if statement "goto continue_unlock" appears only
once, so it can be optimized to reduce the duplicated code.
Signed-off-by: Tiezhu Yang <kernelpatch@126.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/data.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 7f51296..801b0b0 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1207,9 +1207,7 @@ continue_unlock: goto continue_unlock; } - if (step == 0 && !is_cold_data(page)) - goto continue_unlock; - if (step == 1 && is_cold_data(page)) + if (step == is_cold_data(page)) goto continue_unlock; if (PageWriteback(page)) { |