Lines Matching refs:sbi
12 static int migrate_block(struct f2fs_sb_info *sbi, u64 from, u64 to) in migrate_block() argument
31 se = get_seg_entry(sbi, GET_SEGNO(sbi, from)); in migrate_block()
32 offset = OFFSET_IN_SEG(sbi, from); in migrate_block()
38 se = get_seg_entry(sbi, GET_SEGNO(sbi, to)); in migrate_block()
39 offset = OFFSET_IN_SEG(sbi, to); in migrate_block()
46 get_sum_entry(sbi, from, &sum); in migrate_block()
47 update_sum_entry(sbi, to, &sum); in migrate_block()
51 update_data_blkaddr(sbi, le32_to_cpu(sum.nid), in migrate_block()
54 update_nat_blkaddr(sbi, 0, le32_to_cpu(sum.nid), to); in migrate_block()
63 int f2fs_defragment(struct f2fs_sb_info *sbi, u64 from, u64 len, u64 to, int left) in f2fs_defragment() argument
69 flush_journal_entries(sbi); in f2fs_defragment()
74 se = get_seg_entry(sbi, GET_SEGNO(sbi, idx)); in f2fs_defragment()
75 offset = OFFSET_IN_SEG(sbi, idx); in f2fs_defragment()
80 if (find_next_free_block(sbi, &target, left, se->type)) { in f2fs_defragment()
85 if (migrate_block(sbi, idx, target)) { in f2fs_defragment()
92 move_curseg_info(sbi, to); in f2fs_defragment()
93 zero_journal_entries(sbi); in f2fs_defragment()
94 write_curseg_info(sbi); in f2fs_defragment()
97 flush_sit_entries(sbi); in f2fs_defragment()
99 write_checkpoint(sbi); in f2fs_defragment()