Lines Matching defs:segno
37 static int get_device_idx(struct f2fs_sb_info *sbi, uint32_t segno)
43 segno * DEFAULT_BLOCKS_PER_SEGMENT;
52 uint32_t segno, uint32_t dev_idx)
54 block_t seg_start_blkaddr = START_BLOCK(sbi, segno);
60 bool is_usable_seg(struct f2fs_sb_info *sbi, unsigned int segno)
62 unsigned int secno = segno / sbi->segs_per_sec;
63 block_t seg_start = START_BLOCK(sbi, segno);
65 unsigned int dev_idx = get_device_idx(sbi, segno);
66 unsigned int zone_idx = get_zone_idx_from_dev(sbi, segno, dev_idx);
93 bool is_usable_seg(struct f2fs_sb_info *UNUSED(sbi), unsigned int UNUSED(segno))
1905 se = get_seg_entry(sbi, curseg->segno);
1965 unsigned int segno, struct f2fs_summary_block *sum_blk)
1977 addr = START_BLOCK(sbi, segno);
1994 unsigned int segno = 0;
1999 segno = get_cp(cur_data_segno[type]);
2005 segno = get_cp(cur_node_segno[type - CURSEG_HOT_NODE]);
2010 blk_addr = GET_SUM_BLKADDR(sbi, segno);
2020 restore_node_summary(sbi, segno, sum_blk);
2033 u32 segno, offset;
2040 segno = GET_SEGNO(sbi, blk_addr);
2043 se = get_seg_entry(sbi, segno);
2045 sum_blk = get_sum_block(sbi, segno, &type);
2051 ret = dev_write_block(sum_blk, GET_SUM_BLKADDR(sbi, segno));
2077 unsigned int segno;
2097 segno = get_cp(cur_data_segno[i]);
2101 segno = get_cp(cur_node_segno[i - CURSEG_HOT_NODE]);
2103 ASSERT(segno < MAIN_SEGS(sbi));
2106 array[i].segno = segno;
2107 array[i].zone = GET_ZONENO_FROM_SEGNO(sbi, segno);
2123 static inline void check_seg_range(struct f2fs_sb_info *sbi, unsigned int segno)
2126 ASSERT(segno <= end_segno);
2130 unsigned int segno)
2133 unsigned int offset = SIT_BLOCK_OFFSET(sit_i, segno);
2136 check_seg_range(sbi, segno);
2146 unsigned int segno, struct f2fs_sit_block *sit_blk)
2148 block_t blk_addr = current_sit_addr(sbi, segno);
2154 unsigned int segno, struct f2fs_sit_block *sit_blk)
2156 block_t blk_addr = current_sit_addr(sbi, segno);
2162 unsigned int segno, struct f2fs_sit_entry *raw_sit)
2171 ASSERT_MSG("Invalid SIT vblocks: segno=0x%x, %u",
2172 segno, GET_SIT_VBLOCKS(raw_sit));
2175 if (segno > end_segno)
2176 ASSERT_MSG("Invalid SEGNO: 0x%x", segno);
2183 ASSERT_MSG("Wrong SIT valid blocks: segno=0x%x, %u vs. %u",
2184 segno, GET_SIT_VBLOCKS(raw_sit), valid_blocks);
2187 ASSERT_MSG("Wrong SIT type: segno=0x%x, %u",
2188 segno, GET_SIT_TYPE(raw_sit));
2214 unsigned int segno)
2217 return &sit_i->sentries[segno];
2245 unsigned int segno, int *ret_type)
2255 ssa_blk = GET_SUM_BLKADDR(sbi, segno);
2257 if (segno == get_cp(cur_node_segno[type])) {
2260 ASSERT_MSG("segno [0x%x] indicates a data "
2262 segno);
2272 if (segno == get_cp(cur_data_segno[type])) {
2275 ASSERT_MSG("segno [0x%x] indicates a node "
2277 segno);
2304 u32 segno, offset;
2307 segno = GET_SEGNO(sbi, blk_addr);
2310 sum_blk = get_sum_block(sbi, segno, &type);
2449 unsigned int i, segno, end;
2462 segno = start_blk * sit_i->sents_per_block;
2465 for (; segno < end && segno < MAIN_SEGS(sbi); segno++) {
2466 se = &sit_i->sentries[segno];
2468 get_current_sit_page(sbi, segno, sit_blk);
2469 sit = sit_blk->entries[SIT_ENTRY_OFFSET(sit_i, segno)];
2471 check_block_count(sbi, segno, &sit);
2489 segno = le32_to_cpu(segno_in_journal(journal, i));
2491 if (segno >= MAIN_SEGS(sbi)) {
2492 MSG(0, "\tError: build_sit_entries: segno(%u) is invalid!!!\n", segno);
2498 se = &sit_i->sentries[segno];
2501 check_block_count(sbi, segno, &sit);
2555 unsigned int segno = 0;
2568 for (segno = 0; segno < MAIN_SEGS(sbi); segno++) {
2569 se = get_seg_entry(sbi, segno);
2574 if (se->valid_blocks == 0x0 && is_usable_seg(sbi, segno)) {
2575 if (le32_to_cpu(sbi->ckpt->cur_node_segno[0]) == segno ||
2576 le32_to_cpu(sbi->ckpt->cur_data_segno[0]) == segno ||
2577 le32_to_cpu(sbi->ckpt->cur_node_segno[1]) == segno ||
2578 le32_to_cpu(sbi->ckpt->cur_data_segno[1]) == segno ||
2579 le32_to_cpu(sbi->ckpt->cur_node_segno[2]) == segno ||
2580 le32_to_cpu(sbi->ckpt->cur_data_segno[2]) == segno) {
2603 unsigned int segno = 0;
2614 for (segno = 0; segno < MAIN_SEGS(sbi); segno++) {
2621 get_current_sit_page(sbi, segno, sit_blk);
2622 sit = &sit_blk->entries[SIT_ENTRY_OFFSET(sit_i, segno)];
2629 se = get_seg_entry(sbi, segno);
2635 segno, valid_blocks);
2640 rewrite_current_sit_page(sbi, segno, sit_blk);
2654 unsigned int segno;
2663 segno = segno_in_journal(journal, i);
2664 se = get_seg_entry(sbi, segno);
2666 get_current_sit_page(sbi, segno, sit_blk);
2667 sit = &sit_blk->entries[SIT_ENTRY_OFFSET(sit_i, segno)];
2674 rewrite_current_sit_page(sbi, segno, sit_blk);
2732 unsigned int segno = 0;
2737 for (segno = 0; segno < MAIN_SEGS(sbi); segno++) {
2741 se = get_seg_entry(sbi, segno);
2746 get_current_sit_page(sbi, segno, sit_blk);
2747 sit = &sit_blk->entries[SIT_ENTRY_OFFSET(sit_i, segno)];
2751 rewrite_current_sit_page(sbi, segno, sit_blk);
2760 struct seg_entry *se = get_seg_entry(sbi, curseg->segno);
2784 void set_section_type(struct f2fs_sb_info *sbi, unsigned int segno, int type)
2792 struct seg_entry *se = get_seg_entry(sbi, segno + i);
2849 u32 segno;
2865 segno = GET_SEGNO(sbi, *to);
2868 se = get_seg_entry(sbi, segno);
2876 *to = left ? START_BLOCK(sbi, segno) - 1:
2877 START_BLOCK(sbi, segno + 1);
2881 IS_CUR_SEGNO(sbi, segno))
2886 if (vblocks == 0 && !(segno % sbi->segs_per_sec)) {
2891 se2 = get_seg_entry(sbi, segno + i);
2897 write_pointer_at_zone_start(sbi, segno)) {
2898 set_section_type(sbi, segno, want_type);
2937 ssa_blk = GET_SUM_BLKADDR(sbi, curseg->segno);
2946 old_segno = curseg->segno;
2947 curseg->segno = GET_SEGNO(sbi, to);
2951 /* update new segno */
2952 ssa_blk = GET_SUM_BLKADDR(sbi, curseg->segno);
2962 i, old_segno, curseg->segno, from);
2997 set_cp(cur_data_segno[i], CURSEG_I(sbi, i)->segno);
3003 set_cp(cur_node_segno[n], CURSEG_I(sbi, i)->segno);
3181 ssa_blk = GET_SUM_BLKADDR(sbi, curseg->segno);
3504 unsigned int segno, offset;
3510 segno = GET_SEGNO(sbi, blkaddr);
3511 se = get_seg_entry(sbi, segno);
3554 segno = GET_SEGNO(sbi, blkaddr);
3555 se = get_seg_entry(sbi, segno);