Skip to contentSkip to conversation

f2fs: optimize the return condition for has_not_enough_free_secs

PATCH In review Namjae Jeon 1 participant 1 message Feb 2, 2013

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

PATCH 6/6 f2fs: optimize the return condition for has_not_enough_free_secs

From: Namjae Jeon <[email protected]>

Instead of evaluating the free_sections and then deciding to return true/false from that path. We can directly use the evaluation condition for returning proper value.

---
 fs/f2fs/segment.h |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
fs/f2fs/segment.h +2 -4
index a9417b9..458bf5c 100644
@@ -464,10 +464,8 @@ static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi)
 	if (sbi->por_doing)
 		return false;
 
-	if (free_sections(sbi) <= (node_secs + 2 * dent_secs +
-						reserved_sections(sbi)))
-		return true;
-	return false;
+	return (free_sections(sbi) <= (node_secs + 2 * dent_secs +
+						reserved_sections(sbi)));
 }
 
 static inline int utilization(struct f2fs_sb_info *sbi)
Signature · 1 line
1.7.9.5