Skip to contentSkip to conversation

f2fs: optimize f2fs_write_cache_pages

PATCH RESEND New Tiezhu Yang 1 participant 1 message Jul 17, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 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.

---
 fs/f2fs/data.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/f2fs/data.c +1 -3
index b621c08..0219bd0 100644
@@ -1214,9 +1214,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)) {
Signature · 1 line
1.8.3.1