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 (SEGS_TO_BLKS(sbi, GET_R2L_SEGNO(FREE_I(sbi), segno))))
90 (START_BLOCK(sbi, (curseg)->segno) + (curseg)->next_blkoff)
107 #define GET_SEC_FROM_SEG(sbi, segno) \
108 (((segno) == -1) ? -1 : (segno) / SEGS_PER_SEC(sbi))
113 #define GET_ZONE_FROM_SEG(sbi, segno) \
114 GET_ZONE_FROM_SEC(sbi, GET_SEC_FROM_SEG(sbi, segno))
116 #define GET_SUM_BLOCK(sbi, segno) \
117 ((sbi)->sm_info->ssa_blkaddr + (segno))
122 #define SIT_ENTRY_OFFSET(sit_i, segno) \
123 ((segno) % (sit_i)->sents_per_block)
124 #define SIT_BLOCK_OFFSET(segno) \
125 ((segno) / SIT_ENTRY_PER_BLOCK)
126 #define START_SEGNO(segno) \
127 (SIT_BLOCK_OFFSET(segno) * SIT_ENTRY_PER_BLOCK)
297 unsigned int segno; /* current segment number */
307 unsigned int start_segno; /* start segno of sits in set */
320 unsigned int segno)
323 return &sit_i->sentries[segno];
327 unsigned int segno)
330 return &sit_i->sec_entries[GET_SEC_FROM_SEG(sbi, segno)];
334 unsigned int segno, bool use_section)
341 return get_sec_entry(sbi, segno)->valid_blocks;
343 return get_seg_entry(sbi, segno)->valid_blocks;
347 unsigned int segno, bool use_section)
350 unsigned int start_segno = START_SEGNO(segno);
361 return get_seg_entry(sbi, segno)->ckpt_valid_blocks;
417 unsigned int max, unsigned int segno)
421 ret = find_next_bit(free_i->free_segmap, max, segno);
426 static inline void __set_free(struct f2fs_sb_info *sbi, unsigned int segno)
429 unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
432 unsigned int usable_segs = f2fs_usable_segs_in_sec(sbi, segno);
435 clear_bit(segno, free_i->free_segmap);
448 unsigned int segno)
451 unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
453 set_bit(segno, free_i->free_segmap);
460 unsigned int segno, bool inmem)
463 unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
466 unsigned int usable_segs = f2fs_usable_segs_in_sec(sbi, segno);
469 if (test_and_clear_bit(segno, free_i->free_segmap)) {
486 unsigned int segno)
489 unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
492 if (!test_and_set_bit(segno, free_i->free_segmap)) {
563 unsigned segno, left_blocks;
568 segno = CURSEG_I(sbi, i)->segno;
570 get_ckpt_valid_blocks(sbi, segno, true);
576 segno = CURSEG_I(sbi, CURSEG_HOT_DATA)->segno;
578 get_ckpt_valid_blocks(sbi, segno, true);
721 return curseg->segno;
732 unsigned int segno)
734 return segno <= (MAIN_SEGS(sbi) - 1);
752 int segno, struct f2fs_sit_entry *raw_sit)
757 unsigned int usable_blks_per_seg = f2fs_usable_blks_in_seg(sbi, segno);
789 || !valid_main_segno(sbi, segno))) {
790 f2fs_err(sbi, "Wrong valid blocks %d or segno %u",
791 GET_SIT_VBLOCKS(raw_sit), segno);