f2fs: optimize the return condition for has_not_enough_free_secs
authorNamjae Jeon <namjae.jeon@samsung.com>
Sat, 2 Feb 2013 14:53:15 +0000 (23:53 +0900)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Mon, 11 Feb 2013 22:15:02 +0000 (07:15 +0900)
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.

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fs/f2fs/segment.h

index a9417b9..458bf5c 100644 (file)
@@ -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)