Lines Matching refs:segno
306 static unsigned int get_cb_cost(struct f2fs_sb_info *sbi, unsigned int segno) in get_cb_cost() argument
309 unsigned int secno = GET_SEC_FROM_SEG(sbi, segno); in get_cb_cost()
316 unsigned int usable_segs_per_sec = f2fs_usable_segs_in_sec(sbi, segno); in get_cb_cost()
320 vblocks = get_valid_blocks(sbi, segno, true); in get_cb_cost()
340 unsigned int segno, struct victim_sel_policy *p) in get_gc_cost() argument
343 return get_seg_entry(sbi, segno)->ckpt_valid_blocks; in get_gc_cost()
347 return get_valid_blocks(sbi, segno, true); in get_gc_cost()
349 return get_cb_cost(sbi, segno); in get_gc_cost()
368 unsigned long long mtime, unsigned int segno, in attach_victim_entry() argument
378 ve->segno = segno; in attach_victim_entry()
391 unsigned long long mtime, unsigned int segno) in insert_victim_entry() argument
399 attach_victim_entry(sbi, mtime, segno, parent, p, left_most); in insert_victim_entry()
403 struct victim_sel_policy *p, unsigned int segno) in add_victim_entry() argument
406 unsigned int secno = GET_SEC_FROM_SEG(sbi, segno); in add_victim_entry()
413 get_valid_blocks(sbi, segno, true) == 0) in add_victim_entry()
435 insert_victim_entry(sbi, mtime, segno); in add_victim_entry()
497 vblocks = get_valid_blocks(sbi, ve->segno, true); in atgc_lookup_victim()
513 p->min_segno = ve->segno; in atgc_lookup_victim()
566 vblocks = get_seg_entry(sbi, ve->segno)->ckpt_valid_blocks; in atssr_lookup_victim()
582 p->min_segno = ve->segno; in atssr_lookup_victim()
712 unsigned int unit_no, segno; in get_victim_by_default() local
718 segno = unit_no * p.ofs_unit; in get_victim_by_default()
719 if (segno >= last_segment) { in get_victim_by_default()
730 p.offset = segno + p.ofs_unit; in get_victim_by_default()
739 if (test_bit(segno, sm->invalid_segmap)) in get_victim_by_default()
743 secno = GET_SEC_FROM_SEG(sbi, segno); in get_victim_by_default()
755 if (get_ckpt_valid_blocks(sbi, segno, true)) in get_victim_by_default()
763 if (!f2fs_segment_has_free_slot(sbi, segno)) in get_victim_by_default()
772 add_victim_entry(sbi, &p, segno); in get_victim_by_default()
776 cost = get_gc_cost(sbi, segno, &p); in get_victim_by_default()
779 p.min_segno = segno; in get_victim_by_default()
784 if (!sm->last_victim[p.gc_mode] && segno <= last_victim) in get_victim_by_default()
788 sm->last_victim[p.gc_mode] = segno + p.ofs_unit; in get_victim_by_default()
873 unsigned int segno, int offset) in check_valid_map() argument
880 sentry = get_seg_entry(sbi, segno); in check_valid_map()
892 struct f2fs_summary *sum, unsigned int segno, int gc_type) in gc_node_segment() argument
900 unsigned int usable_blks_in_seg = f2fs_usable_blks_in_seg(sbi, segno); in gc_node_segment()
902 start_addr = START_BLOCK(sbi, segno); in gc_node_segment()
920 if (check_valid_map(sbi, segno, off) == 0) in gc_node_segment()
940 if (check_valid_map(sbi, segno, off) == 0) { in gc_node_segment()
1043 unsigned int segno = GET_SEGNO(sbi, blkaddr); in is_alive() local
1046 if (unlikely(check_valid_map(sbi, segno, offset))) { in is_alive()
1047 if (!test_and_set_bit(segno, SIT_I(sbi)->invalid_segmap)) { in is_alive()
1049 blkaddr, source_blkaddr, segno); in is_alive()
1151 int gc_type, unsigned int segno, int off) in move_data_block() argument
1180 if (!check_valid_map(F2FS_I_SB(inode), segno, off)) { in move_data_block()
1322 unsigned int segno, int off) in move_data_page() argument
1331 if (!check_valid_map(F2FS_I_SB(inode), segno, off)) { in move_data_page()
1408 struct gc_inode_list *gc_list, unsigned int segno, int gc_type, in gc_data_segment() argument
1417 unsigned int usable_blks_in_seg = f2fs_usable_blks_in_seg(sbi, segno); in gc_data_segment()
1419 start_addr = START_BLOCK(sbi, segno); in gc_data_segment()
1438 (!force_migrate && get_valid_blocks(sbi, segno, true) == in gc_data_segment()
1442 if (check_valid_map(sbi, segno, off) == 0) in gc_data_segment()
1535 gc_type, segno, off); in gc_data_segment()
1538 segno, off); in gc_data_segment()
1580 unsigned int segno = start_segno; in do_garbage_collect() local
1583 unsigned char type = IS_DATASEG(get_seg_entry(sbi, segno)->type) ? in do_garbage_collect()
1597 f2fs_usable_segs_in_sec(sbi, segno); in do_garbage_collect()
1599 sanity_check_seg_type(sbi, get_seg_entry(sbi, segno)->type); in do_garbage_collect()
1603 f2fs_ra_meta_pages(sbi, GET_SUM_BLOCK(sbi, segno), in do_garbage_collect()
1604 end_segno - segno, META_SSA, true); in do_garbage_collect()
1607 while (segno < end_segno) { in do_garbage_collect()
1608 sum_page = f2fs_get_sum_page(sbi, segno++); in do_garbage_collect()
1612 end_segno = segno - 1; in do_garbage_collect()
1613 for (segno = start_segno; segno < end_segno; segno++) { in do_garbage_collect()
1615 GET_SUM_BLOCK(sbi, segno)); in do_garbage_collect()
1626 for (segno = start_segno; segno < end_segno; segno++) { in do_garbage_collect()
1630 GET_SUM_BLOCK(sbi, segno)); in do_garbage_collect()
1633 if (get_valid_blocks(sbi, segno, false) == 0) in do_garbage_collect()
1644 segno, type, GET_SUM_TYPE((&sum->footer))); in do_garbage_collect()
1659 submitted += gc_node_segment(sbi, sum->entries, segno, in do_garbage_collect()
1663 segno, gc_type, in do_garbage_collect()
1672 get_valid_blocks(sbi, segno, false) == 0) in do_garbage_collect()
1675 if (__is_large_section(sbi) && segno + 1 < end_segno) in do_garbage_collect()
1676 sbi->next_victim_seg[gc_type] = segno + 1; in do_garbage_collect()
1693 bool background, bool force, unsigned int segno) in f2fs_gc() argument
1699 unsigned int init_segno = segno; in f2fs_gc()
1751 ret = __get_victim(sbi, &segno, gc_type); in f2fs_gc()
1755 seg_freed = do_garbage_collect(sbi, segno, &gc_list, gc_type, force); in f2fs_gc()
1757 seg_freed == f2fs_usable_segs_in_sec(sbi, segno)) in f2fs_gc()
1788 segno = NULL_SEGNO; in f2fs_gc()
1795 segno = NULL_SEGNO; in f2fs_gc()
1871 unsigned int segno, next_inuse, start, end; in free_segment_range() local
1897 for (segno = start; segno <= end; segno += sbi->segs_per_sec) { in free_segment_range()
1903 do_garbage_collect(sbi, segno, &gc_list, FG_GC, true); in free_segment_range()
1906 if (!gc_only && get_valid_blocks(sbi, segno, true)) { in free_segment_range()