Commit 737f1899 authored by Tiezhu Yang's avatar Tiezhu Yang Committed by Jaegeuk Kim

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: default avatarTiezhu Yang <kernelpatch@126.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 55f57d2c
...@@ -1207,9 +1207,7 @@ static int f2fs_write_cache_pages(struct address_space *mapping, ...@@ -1207,9 +1207,7 @@ static int f2fs_write_cache_pages(struct address_space *mapping,
goto continue_unlock; goto continue_unlock;
} }
if (step == 0 && !is_cold_data(page)) if (step == is_cold_data(page))
goto continue_unlock;
if (step == 1 && is_cold_data(page))
goto continue_unlock; goto continue_unlock;
if (PageWriteback(page)) { if (PageWriteback(page)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment