Skip to content

Commit cd24284

Browse files
Namjae JeonHashcode
authored andcommitted
f2fs: optimize the return condition for has_not_enough_free_secs
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>
1 parent db3de3f commit cd24284

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

fs/f2fs/segment.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,8 @@ static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi)
464464
if (sbi->por_doing)
465465
return false;
466466

467-
if (free_sections(sbi) <= (node_secs + 2 * dent_secs +
468-
reserved_sections(sbi)))
469-
return true;
470-
return false;
467+
return (free_sections(sbi) <= (node_secs + 2 * dent_secs +
468+
reserved_sections(sbi)));
471469
}
472470

473471
static inline int utilization(struct f2fs_sb_info *sbi)

0 commit comments

Comments
 (0)