Skip to content

Commit

Permalink
f2fs: optimize the return condition for has_not_enough_free_secs
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Amit Sahrawat <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
  • Loading branch information
namjaejeon authored and Hashcode committed Jul 15, 2016
1 parent 7a840ec commit e899887
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/f2fs/segment.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e899887

Please sign in to comment.