aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/segment.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/f2fs/segment.h')
-rw-r--r--fs/f2fs/segment.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index 458bf5c726f7..552dadbb2327 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -450,21 +450,15 @@ static inline bool need_SSR(struct f2fs_sb_info *sbi)
450 return (free_sections(sbi) < overprovision_sections(sbi)); 450 return (free_sections(sbi) < overprovision_sections(sbi));
451} 451}
452 452
453static inline int get_ssr_segment(struct f2fs_sb_info *sbi, int type) 453static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi, int freed)
454{
455 struct curseg_info *curseg = CURSEG_I(sbi, type);
456 return DIRTY_I(sbi)->v_ops->get_victim(sbi,
457 &(curseg)->next_segno, BG_GC, type, SSR);
458}
459
460static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi)
461{ 454{
462 int node_secs = get_blocktype_secs(sbi, F2FS_DIRTY_NODES); 455 int node_secs = get_blocktype_secs(sbi, F2FS_DIRTY_NODES);
463 int dent_secs = get_blocktype_secs(sbi, F2FS_DIRTY_DENTS); 456 int dent_secs = get_blocktype_secs(sbi, F2FS_DIRTY_DENTS);
457
464 if (sbi->por_doing) 458 if (sbi->por_doing)
465 return false; 459 return false;
466 460
467 return (free_sections(sbi) <= (node_secs + 2 * dent_secs + 461 return ((free_sections(sbi) + freed) <= (node_secs + 2 * dent_secs +
468 reserved_sections(sbi))); 462 reserved_sections(sbi)));
469} 463}
470 464