Lines Matching defs:segno
332 static unsigned int get_cb_cost(struct f2fs_sb_info *sbi, unsigned int segno)
335 unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
342 unsigned int usable_segs_per_sec = f2fs_usable_segs_in_sec(sbi, segno);
346 vblocks = get_valid_blocks(sbi, segno, true);
366 unsigned int segno, struct victim_sel_policy *p)
369 return get_seg_entry(sbi, segno)->ckpt_valid_blocks;
373 return get_valid_blocks(sbi, segno, true);
375 return get_cb_cost(sbi, segno);
439 unsigned long long mtime, unsigned int segno)
447 ve->segno = segno;
456 unsigned long long mtime, unsigned int segno)
478 ve = __create_victim_entry(sbi, mtime, segno);
485 struct victim_sel_policy *p, unsigned int segno)
488 unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
495 get_valid_blocks(sbi, segno, true) == 0)
517 __insert_victim_entry(sbi, mtime, segno);
564 vblocks = get_valid_blocks(sbi, ve->segno, true);
580 p->min_segno = ve->segno;
628 vblocks = get_seg_entry(sbi, ve->segno)->ckpt_valid_blocks;
644 p->min_segno = ve->segno;
688 static bool f2fs_pin_section(struct f2fs_sb_info *sbi, unsigned int segno)
691 unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
725 unsigned int segno)
731 if (!f2fs_pin_section(F2FS_I_SB(inode), segno))
818 unsigned int unit_no, segno;
824 segno = unit_no * p.ofs_unit;
825 if (segno >= last_segment) {
836 p.offset = segno + p.ofs_unit;
841 * skip selecting the invalid segno (that is failed due to block
845 if (test_bit(segno, sm->invalid_segmap))
849 secno = GET_SEC_FROM_SEG(sbi, segno);
861 if (get_ckpt_valid_blocks(sbi, segno, true))
869 if (!f2fs_segment_has_free_slot(sbi, segno))
881 add_victim_entry(sbi, &p, segno);
885 cost = get_gc_cost(sbi, segno, &p);
888 p.min_segno = segno;
893 if (!sm->last_victim[p.gc_mode] && segno <= last_victim)
897 sm->last_victim[p.gc_mode] = segno + p.ofs_unit;
979 unsigned int segno, int offset)
986 sentry = get_seg_entry(sbi, segno);
998 struct f2fs_summary *sum, unsigned int segno, int gc_type)
1006 unsigned int usable_blks_in_seg = f2fs_usable_blks_in_seg(sbi, segno);
1008 start_addr = START_BLOCK(sbi, segno);
1026 if (check_valid_map(sbi, segno, off) == 0)
1046 if (check_valid_map(sbi, segno, off) == 0) {
1156 unsigned int segno = GET_SEGNO(sbi, blkaddr);
1159 if (unlikely(check_valid_map(sbi, segno, offset))) {
1160 if (!test_and_set_bit(segno, SIT_I(sbi)->invalid_segmap)) {
1162 blkaddr, source_blkaddr, segno);
1265 int gc_type, unsigned int segno, int off)
1294 if (!check_valid_map(F2FS_I_SB(inode), segno, off)) {
1299 err = f2fs_gc_pinned_control(inode, gc_type, segno);
1424 unsigned int segno, int off)
1433 if (!check_valid_map(F2FS_I_SB(inode), segno, off)) {
1438 err = f2fs_gc_pinned_control(inode, gc_type, segno);
1500 struct gc_inode_list *gc_list, unsigned int segno, int gc_type,
1509 unsigned int usable_blks_in_seg = f2fs_usable_blks_in_seg(sbi, segno);
1511 start_addr = START_BLOCK(sbi, segno);
1530 (!force_migrate && get_valid_blocks(sbi, segno, true) ==
1534 if (check_valid_map(sbi, segno, off) == 0)
1567 err = f2fs_gc_pinned_control(inode, gc_type, segno);
1636 gc_type, segno, off);
1639 segno, off);
1680 unsigned int segno = start_segno;
1683 unsigned char type = IS_DATASEG(get_seg_entry(sbi, segno)->type) ?
1694 * calculate the end segno in the zone which can be garbage collected
1698 f2fs_usable_segs_in_sec(sbi, segno);
1700 sanity_check_seg_type(sbi, get_seg_entry(sbi, segno)->type);
1704 f2fs_ra_meta_pages(sbi, GET_SUM_BLOCK(sbi, segno),
1705 end_segno - segno, META_SSA, true);
1708 while (segno < end_segno) {
1709 sum_page = f2fs_get_sum_page(sbi, segno++);
1713 end_segno = segno - 1;
1714 for (segno = start_segno; segno < end_segno; segno++) {
1716 GET_SUM_BLOCK(sbi, segno));
1727 for (segno = start_segno; segno < end_segno; segno++) {
1731 GET_SUM_BLOCK(sbi, segno));
1734 if (get_valid_blocks(sbi, segno, false) == 0)
1745 segno, type, GET_SUM_TYPE((&sum->footer)));
1760 submitted += gc_node_segment(sbi, sum->entries, segno,
1764 segno, gc_type,
1773 get_valid_blocks(sbi, segno, false) == 0)
1778 (segno + 1 < end_segno) ? segno + 1 : NULL_SEGNO;
1797 unsigned int segno = gc_control->victim_segno;
1855 ret = __get_victim(sbi, &segno, gc_type);
1866 seg_freed = do_garbage_collect(sbi, segno, &gc_list, gc_type,
1870 if (seg_freed == f2fs_usable_segs_in_sec(sbi, segno)) {
1913 segno = NULL_SEGNO;
1986 unsigned int segno, next_inuse, start, end;
2012 for (segno = start; segno <= end; segno += sbi->segs_per_sec) {
2018 do_garbage_collect(sbi, segno, &gc_list, FG_GC, true);
2021 if (!gc_only && get_valid_blocks(sbi, segno, true)) {
2040 f2fs_err(sbi, "segno %u should be free but still inuse!",