Lines Matching defs:segno
22 #define GET_L2R_SEGNO(free_i, segno) ((segno) - (free_i)->start_segno)
23 #define GET_R2L_SEGNO(free_i, segno) ((segno) + (free_i)->start_segno)
40 (((seg) == CURSEG_I(sbi, CURSEG_HOT_DATA)->segno) || \
41 ((seg) == CURSEG_I(sbi, CURSEG_WARM_DATA)->segno) || \
42 ((seg) == CURSEG_I(sbi, CURSEG_COLD_DATA)->segno) || \
43 ((seg) == CURSEG_I(sbi, CURSEG_HOT_NODE)->segno) || \
44 ((seg) == CURSEG_I(sbi, CURSEG_WARM_NODE)->segno) || \
45 ((seg) == CURSEG_I(sbi, CURSEG_COLD_NODE)->segno) || \
46 ((seg) == CURSEG_I(sbi, CURSEG_COLD_DATA_PINNED)->segno) || \
47 ((seg) == CURSEG_I(sbi, CURSEG_ALL_DATA_ATGC)->segno))
50 (((secno) == CURSEG_I(sbi, CURSEG_HOT_DATA)->segno / \
52 ((secno) == CURSEG_I(sbi, CURSEG_WARM_DATA)->segno / \
54 ((secno) == CURSEG_I(sbi, CURSEG_COLD_DATA)->segno / \
56 ((secno) == CURSEG_I(sbi, CURSEG_HOT_NODE)->segno / \
58 ((secno) == CURSEG_I(sbi, CURSEG_WARM_NODE)->segno / \
60 ((secno) == CURSEG_I(sbi, CURSEG_COLD_NODE)->segno / \
62 ((secno) == CURSEG_I(sbi, CURSEG_COLD_DATA_PINNED)->segno / \
64 ((secno) == CURSEG_I(sbi, CURSEG_ALL_DATA_ATGC)->segno / \
86 #define START_BLOCK(sbi, segno) (SEG0_BLKADDR(sbi) + \
87 (GET_R2L_SEGNO(FREE_I(sbi), segno) << (sbi)->log_blocks_per_seg))
90 (START_BLOCK(sbi, (curseg)->segno) + (curseg)->next_blkoff)
110 #define GET_SEC_FROM_SEG(sbi, segno) \
111 (((segno) == -1) ? -1: (segno) / (sbi)->segs_per_sec)
116 #define GET_ZONE_FROM_SEG(sbi, segno) \
117 GET_ZONE_FROM_SEC(sbi, GET_SEC_FROM_SEG(sbi, segno))
119 #define GET_SUM_BLOCK(sbi, segno) \
120 ((sbi)->sm_info->ssa_blkaddr + (segno))
125 #define SIT_ENTRY_OFFSET(sit_i, segno) \
126 ((segno) % (sit_i)->sents_per_block)
127 #define SIT_BLOCK_OFFSET(segno) \
128 ((segno) / SIT_ENTRY_PER_BLOCK)
129 #define START_SEGNO(segno) \
130 (SIT_BLOCK_OFFSET(segno) * SIT_ENTRY_PER_BLOCK)
340 unsigned int segno; /* current segment number */
349 unsigned int start_segno; /* start segno of sits in set */
362 unsigned int segno)
365 return &sit_i->sentries[segno];
369 unsigned int segno)
372 return &sit_i->sec_entries[GET_SEC_FROM_SEG(sbi, segno)];
376 unsigned int segno, bool use_section)
383 return get_sec_entry(sbi, segno)->valid_blocks;
385 return get_seg_entry(sbi, segno)->valid_blocks;
389 unsigned int segno, bool use_section)
392 unsigned int start_segno = START_SEGNO(segno);
403 return get_seg_entry(sbi, segno)->ckpt_valid_blocks;
459 unsigned int max, unsigned int segno)
463 ret = find_next_bit(free_i->free_segmap, max, segno);
468 static inline void __set_free(struct f2fs_sb_info *sbi, unsigned int segno)
471 unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
474 unsigned int usable_segs = f2fs_usable_segs_in_sec(sbi, segno);
477 clear_bit(segno, free_i->free_segmap);
490 unsigned int segno)
493 unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
495 set_bit(segno, free_i->free_segmap);
502 unsigned int segno, bool inmem)
505 unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
508 unsigned int usable_segs = f2fs_usable_segs_in_sec(sbi, segno);
511 if (test_and_clear_bit(segno, free_i->free_segmap)) {
528 unsigned int segno)
531 unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
534 if (!test_and_set_bit(segno, free_i->free_segmap)) {
605 unsigned int segno, left_blocks;
610 segno = CURSEG_I(sbi, i)->segno;
611 left_blocks = f2fs_usable_blks_in_seg(sbi, segno) -
612 get_seg_entry(sbi, segno)->ckpt_valid_blocks;
619 segno = CURSEG_I(sbi, CURSEG_HOT_DATA)->segno;
620 left_blocks = f2fs_usable_blks_in_seg(sbi, segno) -
621 get_seg_entry(sbi, segno)->ckpt_valid_blocks;
710 return curseg->segno;
726 static inline void check_seg_range(struct f2fs_sb_info *sbi, unsigned int segno)
728 f2fs_bug_on(sbi, segno > TOTAL_SEGS(sbi) - 1);
746 int segno, struct f2fs_sit_entry *raw_sit)
751 unsigned int usable_blks_per_seg = f2fs_usable_blks_in_seg(sbi, segno);
782 || segno > TOTAL_SEGS(sbi) - 1)) {
783 f2fs_err(sbi, "Wrong valid blocks %d or segno %u",
784 GET_SIT_VBLOCKS(raw_sit), segno);