Lines Matching refs:sb
35 static void dbg_print_raw_sb_info(struct f2fs_super_block *sb) in dbg_print_raw_sb_info() argument
42 D_DISP_u32(sb, magic); in dbg_print_raw_sb_info()
43 D_DISP_u32(sb, major_ver); in dbg_print_raw_sb_info()
44 D_DISP_u32(sb, minor_ver); in dbg_print_raw_sb_info()
45 D_DISP_u32(sb, log_sectorsize); in dbg_print_raw_sb_info()
46 D_DISP_u32(sb, log_sectors_per_block); in dbg_print_raw_sb_info()
48 D_DISP_u32(sb, log_blocksize); in dbg_print_raw_sb_info()
49 D_DISP_u32(sb, log_blocks_per_seg); in dbg_print_raw_sb_info()
50 D_DISP_u32(sb, segs_per_sec); in dbg_print_raw_sb_info()
51 D_DISP_u32(sb, secs_per_zone); in dbg_print_raw_sb_info()
52 D_DISP_u32(sb, checksum_offset); in dbg_print_raw_sb_info()
53 D_DISP_u64(sb, block_count); in dbg_print_raw_sb_info()
55 D_DISP_u32(sb, section_count); in dbg_print_raw_sb_info()
56 D_DISP_u32(sb, segment_count); in dbg_print_raw_sb_info()
57 D_DISP_u32(sb, segment_count_ckpt); in dbg_print_raw_sb_info()
58 D_DISP_u32(sb, segment_count_sit); in dbg_print_raw_sb_info()
59 D_DISP_u32(sb, segment_count_nat); in dbg_print_raw_sb_info()
61 D_DISP_u32(sb, segment_count_ssa); in dbg_print_raw_sb_info()
62 D_DISP_u32(sb, segment_count_main); in dbg_print_raw_sb_info()
63 D_DISP_u32(sb, segment0_blkaddr); in dbg_print_raw_sb_info()
65 D_DISP_u32(sb, cp_blkaddr); in dbg_print_raw_sb_info()
66 D_DISP_u32(sb, sit_blkaddr); in dbg_print_raw_sb_info()
67 D_DISP_u32(sb, nat_blkaddr); in dbg_print_raw_sb_info()
68 D_DISP_u32(sb, ssa_blkaddr); in dbg_print_raw_sb_info()
69 D_DISP_u32(sb, main_blkaddr); in dbg_print_raw_sb_info()
71 D_DISP_u32(sb, root_ino); in dbg_print_raw_sb_info()
72 D_DISP_u32(sb, node_ino); in dbg_print_raw_sb_info()
73 D_DISP_u32(sb, meta_ino); in dbg_print_raw_sb_info()
74 D_DISP_u32(sb, cp_payload); in dbg_print_raw_sb_info()
189 static int read_f2fs_sb(int fd, struct f2fs_super_block *sb) in read_f2fs_sb() argument
192 rc = read_structure(fd, F2FS_SUPER_OFFSET, sb, sizeof(*sb)); in read_f2fs_sb()
193 if (le32_to_cpu(sb->magic) != F2FS_SUPER_MAGIC) { in read_f2fs_sb()
195 le32_to_cpu(sb->magic), F2FS_SUPER_MAGIC); in read_f2fs_sb()
208 struct f2fs_super_block sb; in get_f2fs_filesystem_size_sec() local
209 if(read_f2fs_sb(fd, &sb)) in get_f2fs_filesystem_size_sec()
211 return (unsigned int)(le64_to_cpu(sb.block_count)*F2FS_BLKSIZE/DEFAULT_SECTOR_SIZE); in get_f2fs_filesystem_size_sec()
262 int get_valid_checkpoint_info(int fd, struct f2fs_super_block *sb, struct f2fs_checkpoint **cp, st… in get_valid_checkpoint_info() argument
270 blk_size = 1U << le32_to_cpu(sb->log_blocksize); in get_valid_checkpoint_info()
275 cp1_start_blk_no = le32_to_cpu(sb->cp_blkaddr); in get_valid_checkpoint_info()
279 cp2_start_blk_no = cp1_start_blk_no + (1 << le32_to_cpu(sb->log_blocks_per_seg)); in get_valid_checkpoint_info()
381 struct f2fs_super_block *sb = NULL; in generate_f2fs_info() local
391 sb = malloc(sizeof(*sb)); in generate_f2fs_info()
392 if(!sb) { in generate_f2fs_info()
397 if (read_f2fs_sb(fd, sb)) { in generate_f2fs_info()
400 free(sb); in generate_f2fs_info()
403 dbg_print_raw_sb_info(sb); in generate_f2fs_info()
405 info->cp_blkaddr = le32_to_cpu(sb->cp_blkaddr); in generate_f2fs_info()
406 info->sit_blkaddr = le32_to_cpu(sb->sit_blkaddr); in generate_f2fs_info()
407 info->nat_blkaddr = le32_to_cpu(sb->nat_blkaddr); in generate_f2fs_info()
408 info->ssa_blkaddr = le32_to_cpu(sb->ssa_blkaddr); in generate_f2fs_info()
409 info->main_blkaddr = le32_to_cpu(sb->main_blkaddr); in generate_f2fs_info()
411 info->total_blocks = sb->block_count; in generate_f2fs_info()
412 …info->blocks_per_sit = (le32_to_cpu(sb->segment_count_sit) >> 1) << le32_to_cpu(sb->log_blocks_per… in generate_f2fs_info()
413 info->blocks_per_segment = 1U << le32_to_cpu(sb->log_blocks_per_seg); in generate_f2fs_info()
415 if (get_valid_checkpoint_info(fd, sb, &cp, info)) in generate_f2fs_info()
449 free(sb); in generate_f2fs_info()