gc_type
enum gc_type type;
int f2fs_move_node_folio(struct folio *node_folio, int gc_type);
int gc_type, int type, char alloc_mode,
#define stat_inc_gc_sec_count(sbi, type, gc_type) \
(F2FS_STAT(sbi)->gc_secs[(type)][(gc_type)]++)
#define stat_inc_gc_seg_count(sbi, type, gc_type) \
(F2FS_STAT(sbi)->gc_segs[(type)][(gc_type)]++)
#define stat_inc_data_blk_count(sbi, blks, gc_type) \
si->bg_data_blks += ((gc_type) == BG_GC) ? (blks) : 0; \
#define stat_inc_node_blk_count(sbi, blks, gc_type) \
si->bg_node_blks += ((gc_type) == BG_GC) ? (blks) : 0; \
#define stat_inc_gc_sec_count(sbi, type, gc_type) do { } while (0)
#define stat_inc_gc_seg_count(sbi, type, gc_type) do { } while (0)
#define stat_inc_data_blk_count(sbi, blks, gc_type) do { } while (0)
#define stat_inc_node_blk_count(sbi, blks, gc_type) do { } while (0)
struct f2fs_summary *sum, unsigned int segno, int gc_type,
bool fggc = (gc_type == FG_GC);
if (gc_type == BG_GC && has_not_enough_free_secs(sbi, 0, 0))
err = f2fs_move_node_folio(node_folio, gc_type);
if (!err && gc_type == FG_GC)
stat_inc_node_blk_count(sbi, 1, gc_type);
int gc_type, unsigned int segno, int off)
int type = fio.sbi->am.atgc_enabled && (gc_type == BG_GC) &&
err = f2fs_gc_pinned_control(inode, gc_type, segno);
static int move_data_page(struct inode *inode, block_t bidx, int gc_type,
err = f2fs_gc_pinned_control(inode, gc_type, segno);
if (gc_type == BG_GC) {
struct gc_inode_list *gc_list, unsigned int segno, int gc_type,
if ((gc_type == BG_GC && has_not_enough_free_secs(sbi, 0, 0)) ||
err = f2fs_gc_pinned_control(inode, gc_type, segno);
gc_type, segno, off);
err = move_data_page(inode, start_bidx, gc_type,
if (!err && (gc_type == FG_GC ||
stat_inc_data_blk_count(sbi, 1, gc_type);
int gc_type, bool one_time)
ret = f2fs_get_victim(sbi, victim, gc_type, NO_CHECK_TYPE,
struct gc_inode_list *gc_list, int gc_type,
if (gc_type == BG_GC || one_time) {
if (gc_type == BG_GC && __is_large_section(sbi) &&
cur_segno, gc_type, &plug);
gc_type, force_migrate, &plug);
stat_inc_gc_seg_count(sbi, data_type, gc_type);
if (gc_type == FG_GC &&
sbi->next_victim_seg[gc_type] =
stat_inc_gc_sec_count(sbi, data_type, gc_type);
int gc_type = gc_control->init_gc_type;
trace_f2fs_gc_begin(sbi->sb, gc_type, gc_control->no_bg_gc,
gc_type = FG_GC;
if (gc_type == BG_GC && gc_control->no_bg_gc) {
ret = __get_victim(sbi, &segno, gc_type, gc_control->one_time);
if (ret == -ENODATA && gc_type == FG_GC &&
seg_freed = do_garbage_collect(sbi, segno, &gc_list, gc_type,
if (gc_type == FG_GC) {
if (gc_type == FG_GC)
int gc_mode, gc_type;
for (gc_type = BG_GC; gc_type <= FG_GC; gc_type++)
if (sbi->next_victim_seg[gc_type] >= start)
sbi->next_victim_seg[gc_type] = NULL_SEGNO;
static int select_gc_type(struct f2fs_sb_info *sbi, int gc_type)
if (gc_type == BG_GC) {
static void select_policy(struct f2fs_sb_info *sbi, int gc_type,
p->gc_mode = select_gc_type(sbi, gc_type);
if (gc_type != FG_GC &&
static int f2fs_gc_pinned_control(struct inode *inode, int gc_type,
if (gc_type != FG_GC)
int gc_type, int type, char alloc_mode,
select_policy(sbi, gc_type, type, &p);
if (gc_type == FG_GC)
if (gc_type == FG_GC &&
if (p.alloc_mode == LFS && gc_type == FG_GC) {
if (gc_type == BG_GC && test_bit(secno, dirty_i->victim_secmap))
if (gc_type == FG_GC && f2fs_section_is_pinned(dirty_i, secno))
if (gc_type == FG_GC)
trace_f2fs_get_victim(sbi->sb, type, gc_type, &p,
int f2fs_move_node_folio(struct folio *node_folio, int gc_type)
if (gc_type == FG_GC) {
TP_PROTO(struct super_block *sb, int gc_type, bool no_bg_gc,
TP_ARGS(sb, gc_type, no_bg_gc, nr_free_secs, dirty_nodes,
__field(int, gc_type)
__entry->gc_type = gc_type;
show_gc_type(__entry->gc_type),
(__entry->gc_type == BG_GC) ? __entry->no_bg_gc : -1,
TP_PROTO(struct super_block *sb, int type, int gc_type,
TP_ARGS(sb, type, gc_type, p, pre_victim, prefree, free),
__field(int, gc_type)
__entry->gc_type = gc_type;
show_gc_type(__entry->gc_type),