Lines Matching defs:cp
75 static void dbg_print_raw_ckpt_struct(struct f2fs_checkpoint *cp)
82 D_DISP_u64(cp, checkpoint_ver);
83 D_DISP_u64(cp, user_block_count);
84 D_DISP_u64(cp, valid_block_count);
85 D_DISP_u32(cp, rsvd_segment_count);
86 D_DISP_u32(cp, overprov_segment_count);
87 D_DISP_u32(cp, free_segment_count);
89 D_DISP_u32(cp, alloc_type[CURSEG_HOT_NODE]);
90 D_DISP_u32(cp, alloc_type[CURSEG_WARM_NODE]);
91 D_DISP_u32(cp, alloc_type[CURSEG_COLD_NODE]);
92 D_DISP_u32(cp, cur_node_segno[0]);
93 D_DISP_u32(cp, cur_node_segno[1]);
94 D_DISP_u32(cp, cur_node_segno[2]);
96 D_DISP_u32(cp, cur_node_blkoff[0]);
97 D_DISP_u32(cp, cur_node_blkoff[1]);
98 D_DISP_u32(cp, cur_node_blkoff[2]);
101 D_DISP_u32(cp, alloc_type[CURSEG_HOT_DATA]);
102 D_DISP_u32(cp, alloc_type[CURSEG_WARM_DATA]);
103 D_DISP_u32(cp, alloc_type[CURSEG_COLD_DATA]);
104 D_DISP_u32(cp, cur_data_segno[0]);
105 D_DISP_u32(cp, cur_data_segno[1]);
106 D_DISP_u32(cp, cur_data_segno[2]);
108 D_DISP_u32(cp, cur_data_blkoff[0]);
109 D_DISP_u32(cp, cur_data_blkoff[1]);
110 D_DISP_u32(cp, cur_data_blkoff[2]);
112 D_DISP_u32(cp, ckpt_flags);
113 D_DISP_u32(cp, cp_pack_total_block_count);
114 D_DISP_u32(cp, cp_pack_start_sum);
115 D_DISP_u32(cp, valid_node_count);
116 D_DISP_u32(cp, valid_inode_count);
117 D_DISP_u32(cp, next_free_nid);
118 D_DISP_u32(cp, sit_ver_bitmap_bytesize);
119 D_DISP_u32(cp, nat_ver_bitmap_bytesize);
120 D_DISP_u32(cp, checksum_offset);
121 D_DISP_u64(cp, elapsed_time);
123 D_DISP_u32(cp, sit_nat_version_bitmap[0]);
222 /* Read the 1st cp block in this CP pack */
235 /* Read the 2nd cp block in this CP pack */
259 int get_valid_checkpoint_info(int fd, struct f2fs_super_block *sb, struct f2fs_checkpoint **cp, struct f2fs_info *info)
274 * Find valid cp by reading both packs and finding most recent one.
303 *cp = cur_cp;
339 static inline int is_set_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f)
341 unsigned int ckpt_flags = le32_to_cpu(cp->ckpt_flags);
345 static inline u64 sum_blk_addr(struct f2fs_checkpoint *cp, struct f2fs_info *info, int base, int type)
347 return info->cp_valid_cp_blkaddr + le32_to_cpu(cp->cp_pack_total_block_count)
351 static int get_sit_summary(int fd, struct f2fs_info *info, struct f2fs_checkpoint *cp)
360 if (is_set_ckpt_flags(cp, CP_COMPACT_SUM_FLAG)) {
361 if (read_structure_blk(fd, info->cp_valid_cp_blkaddr + le32_to_cpu(cp->cp_pack_start_sum), buffer, 1))
366 if (is_set_ckpt_flags(cp, CP_UMOUNT_FLAG))
367 blk_addr = sum_blk_addr(cp, info, NR_CURSEG_TYPE, CURSEG_COLD_DATA);
369 blk_addr = sum_blk_addr(cp, info, NR_CURSEG_DATA_TYPE, CURSEG_COLD_DATA);
382 struct f2fs_checkpoint *cp = NULL;
415 if (get_valid_checkpoint_info(fd, sb, &cp, info))
417 dbg_print_raw_ckpt_struct(cp);
419 info->total_user_used = le32_to_cpu(cp->valid_block_count);
421 u32 bmp_size = le32_to_cpu(cp->sit_ver_bitmap_bytesize);
442 if (get_sit_summary(fd, info, cp)) {
450 free(cp);