diff options
Diffstat (limited to 'fs/f2fs/segment.h')
-rw-r--r-- | fs/f2fs/segment.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index 0948405af6f5..552dadbb2327 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -450,16 +450,16 @@ static inline bool need_SSR(struct f2fs_sb_info *sbi) return (free_sections(sbi) < overprovision_sections(sbi)); } -static inline int get_ssr_segment(struct f2fs_sb_info *sbi, int type) +static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi, int freed) { - struct curseg_info *curseg = CURSEG_I(sbi, type); - return DIRTY_I(sbi)->v_ops->get_victim(sbi, - &(curseg)->next_segno, BG_GC, type, SSR); -} + int node_secs = get_blocktype_secs(sbi, F2FS_DIRTY_NODES); + int dent_secs = get_blocktype_secs(sbi, F2FS_DIRTY_DENTS); -static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi) -{ - return free_sections(sbi) <= reserved_sections(sbi); + if (sbi->por_doing) + return false; + + return ((free_sections(sbi) + freed) <= (node_secs + 2 * dent_secs + + reserved_sections(sbi))); } static inline int utilization(struct f2fs_sb_info *sbi) |