Lines Matching refs:segno
33 static int get_device_idx(struct f2fs_sb_info *sbi, u_int32_t segno) in get_device_idx() argument
39 segno * DEFAULT_BLOCKS_PER_SEGMENT; in get_device_idx()
50 u_int32_t segno, u_int32_t dev_idx) in get_zone_idx_from_dev() argument
52 block_t seg_start_blkaddr = START_BLOCK(sbi, segno); in get_zone_idx_from_dev()
58 bool is_usable_seg(struct f2fs_sb_info *sbi, unsigned int segno) in is_usable_seg() argument
60 unsigned int secno = segno / sbi->segs_per_sec; in is_usable_seg()
61 block_t seg_start = START_BLOCK(sbi, segno); in is_usable_seg()
63 unsigned int dev_idx = get_device_idx(sbi, segno); in is_usable_seg()
64 unsigned int zone_idx = get_zone_idx_from_dev(sbi, segno, dev_idx); in is_usable_seg()
91 bool is_usable_seg(struct f2fs_sb_info *UNUSED(sbi), unsigned int UNUSED(segno)) in is_usable_seg() argument
1775 se = get_seg_entry(sbi, curseg->segno); in reset_curseg()
1835 unsigned int segno, struct f2fs_summary_block *sum_blk) in restore_node_summary() argument
1847 addr = START_BLOCK(sbi, segno); in restore_node_summary()
1864 unsigned int segno = 0; in read_normal_summaries() local
1869 segno = get_cp(cur_data_segno[type]); in read_normal_summaries()
1875 segno = get_cp(cur_node_segno[type - CURSEG_HOT_NODE]); in read_normal_summaries()
1880 blk_addr = GET_SUM_BLKADDR(sbi, segno); in read_normal_summaries()
1890 restore_node_summary(sbi, segno, sum_blk); in read_normal_summaries()
1903 u32 segno, offset; in update_sum_entry() local
1910 segno = GET_SEGNO(sbi, blk_addr); in update_sum_entry()
1913 se = get_seg_entry(sbi, segno); in update_sum_entry()
1915 sum_blk = get_sum_block(sbi, segno, &type); in update_sum_entry()
1921 ret = dev_write_block(sum_blk, GET_SUM_BLKADDR(sbi, segno)); in update_sum_entry()
1947 unsigned int segno; in build_curseg() local
1967 segno = get_cp(cur_data_segno[i]); in build_curseg()
1971 segno = get_cp(cur_node_segno[i - CURSEG_HOT_NODE]); in build_curseg()
1973 ASSERT(segno < TOTAL_SEGS(sbi)); in build_curseg()
1976 array[i].segno = segno; in build_curseg()
1977 array[i].zone = GET_ZONENO_FROM_SEGNO(sbi, segno); in build_curseg()
1993 static inline void check_seg_range(struct f2fs_sb_info *sbi, unsigned int segno) in check_seg_range() argument
1996 ASSERT(segno <= end_segno); in check_seg_range()
2000 unsigned int segno) in current_sit_addr() argument
2003 unsigned int offset = SIT_BLOCK_OFFSET(sit_i, segno); in current_sit_addr()
2006 check_seg_range(sbi, segno); in current_sit_addr()
2016 unsigned int segno, struct f2fs_sit_block *sit_blk) in get_current_sit_page() argument
2018 block_t blk_addr = current_sit_addr(sbi, segno); in get_current_sit_page()
2024 unsigned int segno, struct f2fs_sit_block *sit_blk) in rewrite_current_sit_page() argument
2026 block_t blk_addr = current_sit_addr(sbi, segno); in rewrite_current_sit_page()
2032 unsigned int segno, struct f2fs_sit_entry *raw_sit) in check_block_count() argument
2042 segno, GET_SIT_VBLOCKS(raw_sit)); in check_block_count()
2045 if (segno > end_segno) in check_block_count()
2046 ASSERT_MSG("Invalid SEGNO: 0x%x", segno); in check_block_count()
2054 segno, GET_SIT_VBLOCKS(raw_sit), valid_blocks); in check_block_count()
2058 segno, GET_SIT_TYPE(raw_sit)); in check_block_count()
2084 unsigned int segno) in get_seg_entry() argument
2087 return &sit_i->sentries[segno]; in get_seg_entry()
2115 unsigned int segno, int *ret_type) in get_sum_block() argument
2125 ssa_blk = GET_SUM_BLKADDR(sbi, segno); in get_sum_block()
2127 if (segno == get_cp(cur_node_segno[type])) { in get_sum_block()
2132 segno); in get_sum_block()
2142 if (segno == get_cp(cur_data_segno[type])) { in get_sum_block()
2147 segno); in get_sum_block()
2174 u32 segno, offset; in get_sum_entry() local
2177 segno = GET_SEGNO(sbi, blk_addr); in get_sum_entry()
2180 sum_blk = get_sum_block(sbi, segno, &type); in get_sum_entry()
2319 unsigned int i, segno, end; in build_sit_entries() local
2332 segno = start_blk * sit_i->sents_per_block; in build_sit_entries()
2335 for (; segno < end && segno < TOTAL_SEGS(sbi); segno++) { in build_sit_entries()
2336 se = &sit_i->sentries[segno]; in build_sit_entries()
2338 get_current_sit_page(sbi, segno, sit_blk); in build_sit_entries()
2339 sit = sit_blk->entries[SIT_ENTRY_OFFSET(sit_i, segno)]; in build_sit_entries()
2341 check_block_count(sbi, segno, &sit); in build_sit_entries()
2359 segno = le32_to_cpu(segno_in_journal(journal, i)); in build_sit_entries()
2361 if (segno >= TOTAL_SEGS(sbi)) { in build_sit_entries()
2362 MSG(0, "\tError: build_sit_entries: segno(%u) is invalid!!!\n", segno); in build_sit_entries()
2368 se = &sit_i->sentries[segno]; in build_sit_entries()
2371 check_block_count(sbi, segno, &sit); in build_sit_entries()
2425 unsigned int segno = 0; in build_sit_area_bitmap() local
2438 for (segno = 0; segno < TOTAL_SEGS(sbi); segno++) { in build_sit_area_bitmap()
2439 se = get_seg_entry(sbi, segno); in build_sit_area_bitmap()
2444 if (se->valid_blocks == 0x0 && is_usable_seg(sbi, segno)) { in build_sit_area_bitmap()
2445 if (le32_to_cpu(sbi->ckpt->cur_node_segno[0]) == segno || in build_sit_area_bitmap()
2446 le32_to_cpu(sbi->ckpt->cur_data_segno[0]) == segno || in build_sit_area_bitmap()
2447 le32_to_cpu(sbi->ckpt->cur_node_segno[1]) == segno || in build_sit_area_bitmap()
2448 le32_to_cpu(sbi->ckpt->cur_data_segno[1]) == segno || in build_sit_area_bitmap()
2449 le32_to_cpu(sbi->ckpt->cur_node_segno[2]) == segno || in build_sit_area_bitmap()
2450 le32_to_cpu(sbi->ckpt->cur_data_segno[2]) == segno) { in build_sit_area_bitmap()
2473 unsigned int segno = 0; in rewrite_sit_area_bitmap() local
2484 for (segno = 0; segno < TOTAL_SEGS(sbi); segno++) { in rewrite_sit_area_bitmap()
2491 get_current_sit_page(sbi, segno, sit_blk); in rewrite_sit_area_bitmap()
2492 sit = &sit_blk->entries[SIT_ENTRY_OFFSET(sit_i, segno)]; in rewrite_sit_area_bitmap()
2499 se = get_seg_entry(sbi, segno); in rewrite_sit_area_bitmap()
2505 segno, valid_blocks); in rewrite_sit_area_bitmap()
2510 rewrite_current_sit_page(sbi, segno, sit_blk); in rewrite_sit_area_bitmap()
2524 unsigned int segno; in flush_sit_journal_entries() local
2533 segno = segno_in_journal(journal, i); in flush_sit_journal_entries()
2534 se = get_seg_entry(sbi, segno); in flush_sit_journal_entries()
2536 get_current_sit_page(sbi, segno, sit_blk); in flush_sit_journal_entries()
2537 sit = &sit_blk->entries[SIT_ENTRY_OFFSET(sit_i, segno)]; in flush_sit_journal_entries()
2544 rewrite_current_sit_page(sbi, segno, sit_blk); in flush_sit_journal_entries()
2602 unsigned int segno = 0; in flush_sit_entries() local
2607 for (segno = 0; segno < TOTAL_SEGS(sbi); segno++) { in flush_sit_entries()
2611 se = get_seg_entry(sbi, segno); in flush_sit_entries()
2616 get_current_sit_page(sbi, segno, sit_blk); in flush_sit_entries()
2617 sit = &sit_blk->entries[SIT_ENTRY_OFFSET(sit_i, segno)]; in flush_sit_entries()
2621 rewrite_current_sit_page(sbi, segno, sit_blk); in flush_sit_entries()
2630 struct seg_entry *se = get_seg_entry(sbi, curseg->segno); in relocate_curseg_offset()
2654 void set_section_type(struct f2fs_sb_info *sbi, unsigned int segno, int type) in set_section_type() argument
2662 struct seg_entry *se = get_seg_entry(sbi, segno + i); in set_section_type()
2719 u32 segno; in find_next_free_block() local
2735 segno = GET_SEGNO(sbi, *to); in find_next_free_block()
2738 se = get_seg_entry(sbi, segno); in find_next_free_block()
2746 *to = left ? START_BLOCK(sbi, segno) - 1: in find_next_free_block()
2747 START_BLOCK(sbi, segno + 1); in find_next_free_block()
2751 IS_CUR_SEGNO(sbi, segno)) in find_next_free_block()
2756 if (vblocks == 0 && !(segno % sbi->segs_per_sec)) { in find_next_free_block()
2761 se2 = get_seg_entry(sbi, segno + i); in find_next_free_block()
2767 write_pointer_at_zone_start(sbi, segno)) { in find_next_free_block()
2768 set_section_type(sbi, segno, want_type); in find_next_free_block()
2799 ssa_blk = GET_SUM_BLKADDR(sbi, curseg->segno); in move_one_curseg_info()
2808 old_segno = curseg->segno; in move_one_curseg_info()
2809 curseg->segno = GET_SEGNO(sbi, to); in move_one_curseg_info()
2814 ssa_blk = GET_SUM_BLKADDR(sbi, curseg->segno); in move_one_curseg_info()
2824 i, old_segno, curseg->segno, from); in move_one_curseg_info()
2859 set_cp(cur_data_segno[i], CURSEG_I(sbi, i)->segno); in write_curseg_info()
2865 set_cp(cur_node_segno[n], CURSEG_I(sbi, i)->segno); in write_curseg_info()
3043 ssa_blk = GET_SUM_BLKADDR(sbi, curseg->segno); in write_checkpoint()
3366 unsigned int segno, offset; in do_record_fsync_data() local
3372 segno = GET_SEGNO(sbi, blkaddr); in do_record_fsync_data()
3373 se = get_seg_entry(sbi, segno); in do_record_fsync_data()
3416 segno = GET_SEGNO(sbi, blkaddr); in do_record_fsync_data()
3417 se = get_seg_entry(sbi, segno); in do_record_fsync_data()