Lines Matching defs:segno
305 static unsigned int get_cb_cost(struct f2fs_sb_info *sbi, unsigned int segno)
308 unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
315 unsigned int usable_segs_per_sec = f2fs_usable_segs_in_sec(sbi, segno);
319 vblocks = get_valid_blocks(sbi, segno, true);
339 unsigned int segno, struct victim_sel_policy *p)
342 return get_seg_entry(sbi, segno)->ckpt_valid_blocks;
346 return get_valid_blocks(sbi, segno, true);
348 return get_cb_cost(sbi, segno);
367 unsigned long long mtime, unsigned int segno,
377 ve->segno = segno;
390 unsigned long long mtime, unsigned int segno)
398 attach_victim_entry(sbi, mtime, segno, parent, p, left_most);
402 struct victim_sel_policy *p, unsigned int segno)
405 unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
412 get_valid_blocks(sbi, segno, true) == 0)
434 insert_victim_entry(sbi, mtime, segno);
496 vblocks = get_valid_blocks(sbi, ve->segno, true);
512 p->min_segno = ve->segno;
565 vblocks = get_seg_entry(sbi, ve->segno)->ckpt_valid_blocks;
581 p->min_segno = ve->segno;
711 unsigned int unit_no, segno;
717 segno = unit_no * p.ofs_unit;
718 if (segno >= last_segment) {
729 p.offset = segno + p.ofs_unit;
734 * skip selecting the invalid segno (that is failed due to block
738 if (test_bit(segno, sm->invalid_segmap))
742 secno = GET_SEC_FROM_SEG(sbi, segno);
754 if (get_ckpt_valid_blocks(sbi, segno, true))
762 if (!f2fs_segment_has_free_slot(sbi, segno))
771 add_victim_entry(sbi, &p, segno);
775 cost = get_gc_cost(sbi, segno, &p);
778 p.min_segno = segno;
783 if (!sm->last_victim[p.gc_mode] && segno <= last_victim)
787 sm->last_victim[p.gc_mode] = segno + p.ofs_unit;
871 unsigned int segno, int offset)
878 sentry = get_seg_entry(sbi, segno);
890 struct f2fs_summary *sum, unsigned int segno, int gc_type)
898 unsigned int usable_blks_in_seg = f2fs_usable_blks_in_seg(sbi, segno);
900 start_addr = START_BLOCK(sbi, segno);
918 if (check_valid_map(sbi, segno, off) == 0)
938 if (check_valid_map(sbi, segno, off) == 0) {
1046 unsigned int segno = GET_SEGNO(sbi, blkaddr);
1049 if (unlikely(check_valid_map(sbi, segno, offset))) {
1050 if (!test_and_set_bit(segno, SIT_I(sbi)->invalid_segmap)) {
1052 blkaddr, source_blkaddr, segno);
1154 int gc_type, unsigned int segno, int off)
1182 if (!check_valid_map(F2FS_I_SB(inode), segno, off)) {
1325 unsigned int segno, int off)
1334 if (!check_valid_map(F2FS_I_SB(inode), segno, off)) {
1411 struct gc_inode_list *gc_list, unsigned int segno, int gc_type,
1420 unsigned int usable_blks_in_seg = f2fs_usable_blks_in_seg(sbi, segno);
1422 start_addr = START_BLOCK(sbi, segno);
1441 (!force_migrate && get_valid_blocks(sbi, segno, true) ==
1445 if (check_valid_map(sbi, segno, off) == 0)
1541 gc_type, segno, off);
1544 segno, off);
1586 unsigned int segno = start_segno;
1589 unsigned char type = IS_DATASEG(get_seg_entry(sbi, segno)->type) ?
1599 * calculate the end segno in the zone which can be garbage collected
1603 f2fs_usable_segs_in_sec(sbi, segno);
1605 sanity_check_seg_type(sbi, get_seg_entry(sbi, segno)->type);
1609 f2fs_ra_meta_pages(sbi, GET_SUM_BLOCK(sbi, segno),
1610 end_segno - segno, META_SSA, true);
1613 while (segno < end_segno) {
1614 sum_page = f2fs_get_sum_page(sbi, segno++);
1618 end_segno = segno - 1;
1619 for (segno = start_segno; segno < end_segno; segno++) {
1621 GET_SUM_BLOCK(sbi, segno));
1632 for (segno = start_segno; segno < end_segno; segno++) {
1636 GET_SUM_BLOCK(sbi, segno));
1639 if (get_valid_blocks(sbi, segno, false) == 0)
1650 segno, type, GET_SUM_TYPE((&sum->footer)));
1664 submitted += gc_node_segment(sbi, sum->entries, segno,
1668 segno, gc_type,
1676 get_valid_blocks(sbi, segno, false) == 0)
1681 (segno + 1 < end_segno) ? segno + 1 : NULL_SEGNO;
1698 bool background, bool force, unsigned int segno)
1704 unsigned int init_segno = segno;
1756 ret = __get_victim(sbi, &segno, gc_type);
1760 seg_freed = do_garbage_collect(sbi, segno, &gc_list, gc_type, force);
1762 seg_freed == f2fs_usable_segs_in_sec(sbi, segno))
1793 segno = NULL_SEGNO;
1800 segno = NULL_SEGNO;
1876 unsigned int segno, next_inuse, start, end;
1902 for (segno = start; segno <= end; segno += sbi->segs_per_sec) {
1908 do_garbage_collect(sbi, segno, &gc_list, FG_GC, true);
1911 if (!gc_only && get_valid_blocks(sbi, segno, true)) {
1929 f2fs_err(sbi, "segno %u should be free but still inuse!",