From: Tiezhu Yang Date: Fri, 17 Jul 2015 04:56:00 +0000 (+0800) Subject: f2fs: optimize f2fs_write_cache_pages X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=737f18992ee81cab897336e84c5c7f4e179dfd61;p=deliverable%2Flinux.git 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 Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 7f51296fbbf6..801b0b0b08f4 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)) {