• Home
  • Raw
  • Download

Lines Matching refs:fs

121 static void print_bg_opts(ext2_filsys fs, dgrp_t i)  in print_bg_opts()  argument
125 if (ext2fs_has_group_desc_csum(fs)) in print_bg_opts()
126 bg_flags = ext2fs_bg_flags(fs, i); in print_bg_opts()
139 static void print_bg_rel_offset(ext2_filsys fs, blk64_t block, int itable, in print_bg_rel_offset() argument
146 } else if (ext2fs_has_feature_flex_bg(fs->super)) { in print_bg_rel_offset()
147 dgrp_t flex_grp = ext2fs_group_of_blk2(fs, block); in print_bg_rel_offset()
149 (unsigned)(block-ext2fs_group_first_block2(fs,flex_grp))); in print_bg_rel_offset()
153 static void list_desc(ext2_filsys fs, int grp_only) in list_desc() argument
163 blk64_t blk_itr = EXT2FS_B2C(fs, fs->super->s_first_data_block); in list_desc()
167 if (ext2fs_has_feature_bigalloc(fs->super)) in list_desc()
170 block_nbytes = EXT2_CLUSTERS_PER_GROUP(fs->super) / 8; in list_desc()
171 inode_nbytes = EXT2_INODES_PER_GROUP(fs->super) / 8; in list_desc()
173 if (fs->block_map) in list_desc()
175 if (fs->inode_map) in list_desc()
178 inode_blocks_per_group = ((fs->super->s_inodes_per_group * in list_desc()
179 EXT2_INODE_SIZE(fs->super)) + in list_desc()
180 EXT2_BLOCK_SIZE(fs->super) - 1) / in list_desc()
181 EXT2_BLOCK_SIZE(fs->super); in list_desc()
182 reserved_gdt = fs->super->s_reserved_gdt_blocks; in list_desc()
184 first_block = fs->super->s_first_data_block; in list_desc()
185 if (ext2fs_has_feature_meta_bg(fs->super)) in list_desc()
186 old_desc_blocks = fs->super->s_first_meta_bg; in list_desc()
188 old_desc_blocks = fs->desc_blocks; in list_desc()
191 for (i = 0; i < fs->group_desc_count; i++) { in list_desc()
192 first_block = ext2fs_group_first_block2(fs, i); in list_desc()
193 last_block = ext2fs_group_last_block2(fs, i); in list_desc()
195 ext2fs_super_and_bgd_loc2(fs, i, &super_blk, in list_desc()
213 ext2fs_block_bitmap_loc(fs, i), in list_desc()
214 ext2fs_inode_bitmap_loc(fs, i), in list_desc()
215 ext2fs_inode_table_loc(fs, i)); in list_desc()
222 if (ext2fs_has_group_desc_csum(fs)) { in list_desc()
223 unsigned csum = ext2fs_bg_checksum(fs, i); in list_desc()
224 unsigned exp_csum = ext2fs_group_desc_csum(fs, i); in list_desc()
230 print_bg_opts(fs, i); in list_desc()
256 print_number(ext2fs_block_bitmap_loc(fs, i)); in list_desc()
257 print_bg_rel_offset(fs, ext2fs_block_bitmap_loc(fs, i), 0, in list_desc()
259 if (ext2fs_has_feature_metadata_csum(fs->super)) in list_desc()
261 ext2fs_block_bitmap_checksum(fs, i)); in list_desc()
267 print_number(ext2fs_inode_bitmap_loc(fs, i)); in list_desc()
268 print_bg_rel_offset(fs, ext2fs_inode_bitmap_loc(fs, i), 0, in list_desc()
270 if (ext2fs_has_feature_metadata_csum(fs->super)) in list_desc()
272 ext2fs_inode_bitmap_checksum(fs, i)); in list_desc()
274 print_range(ext2fs_inode_table_loc(fs, i), in list_desc()
275 ext2fs_inode_table_loc(fs, i) + in list_desc()
277 print_bg_rel_offset(fs, ext2fs_inode_table_loc(fs, i), 1, in list_desc()
281 ext2fs_bg_free_blocks_count(fs, i), units, in list_desc()
282 ext2fs_bg_free_inodes_count(fs, i), in list_desc()
283 ext2fs_bg_used_dirs_count(fs, i), in list_desc()
284 ext2fs_bg_itable_unused(fs, i) ? "" : "\n"); in list_desc()
285 if (ext2fs_bg_itable_unused(fs, i)) in list_desc()
287 ext2fs_bg_itable_unused(fs, i)); in list_desc()
290 retval = ext2fs_get_block_bitmap_range2(fs->block_map, in list_desc()
297 fs->super->s_clusters_per_group, in list_desc()
298 fs->super->s_first_data_block, in list_desc()
299 EXT2FS_CLUSTER_RATIO(fs)); in list_desc()
301 blk_itr += fs->super->s_clusters_per_group; in list_desc()
305 retval = ext2fs_get_inode_bitmap_range2(fs->inode_map, in list_desc()
312 fs->super->s_inodes_per_group, in list_desc()
315 ino_itr += fs->super->s_inodes_per_group; in list_desc()
324 static void list_bad_blocks(ext2_filsys fs, int dump) in list_bad_blocks() argument
332 retval = ext2fs_read_bb_inode(fs, &bb_list); in list_bad_blocks()
359 static void print_inline_journal_information(ext2_filsys fs) in print_inline_journal_information() argument
365 ino_t ino = fs->super->s_journal_inum; in print_inline_journal_information()
368 if (fs->flags & EXT2_FLAG_IMAGE_FILE) in print_inline_journal_information()
370 retval = ext2fs_read_inode(fs, ino, &inode); in print_inline_journal_information()
376 retval = ext2fs_file_open2(fs, ino, &inode, 0, &journal_file); in print_inline_journal_information()
395 e2p_list_journal_super(stdout, buf, fs->blocksize, 0); in print_inline_journal_information()
398 static void print_journal_information(ext2_filsys fs) in print_journal_information() argument
405 if ((retval = io_channel_read_blk64(fs->io, in print_journal_information()
406 fs->super->s_first_data_block + 1, in print_journal_information()
420 e2p_list_journal_super(stdout, buf, fs->blocksize, 0); in print_journal_information()
423 static int check_mmp(ext2_filsys fs) in check_mmp() argument
429 retval = ext2fs_mmp_start(fs); in check_mmp()
432 fs->device_name); in check_mmp()
437 if (fs->mmp_buf) { in check_mmp()
438 struct mmp_struct *mmp = fs->mmp_buf; in check_mmp()
452 program_name, fs->device_name); in check_mmp()
458 static void print_mmp_block(ext2_filsys fs) in print_mmp_block() argument
464 if (fs->mmp_buf == NULL) { in print_mmp_block()
465 retval = ext2fs_get_mem(fs->blocksize, &fs->mmp_buf); in print_mmp_block()
473 retval = ext2fs_mmp_read(fs, fs->super->s_mmp_block, fs->mmp_buf); in print_mmp_block()
480 fs->super->s_mmp_block, fs->device_name); in print_mmp_block()
484 mmp = fs->mmp_buf; in print_mmp_block()
578 ext2_filsys fs; in main() local
677 &fs); in main()
683 use_blocksize, unix_io_manager, &fs); in main()
699 fs->default_bitmap_type = EXT2FS_BMAP64_RBTREE; in main()
700 if (ext2fs_has_feature_64bit(fs->super)) in main()
703 if (ext2fs_has_feature_mmp(fs->super) && in main()
704 fs->super->s_mmp_block != 0) { in main()
706 print_mmp_block(fs); in main()
708 print_number(fs->super->s_mmp_block); in main()
711 retval = check_mmp(fs); in main()
721 list_bad_blocks(fs, 1); in main()
725 list_super(fs->super); in main()
726 if (ext2fs_has_feature_journal_dev(fs->super)) { in main()
727 print_journal_information(fs); in main()
731 if (ext2fs_has_feature_journal(fs->super) && in main()
732 (fs->super->s_journal_inum != 0)) in main()
733 print_inline_journal_information(fs); in main()
734 if (ext2fs_has_feature_mmp(fs->super) && in main()
735 fs->super->s_mmp_block != 0) in main()
736 print_mmp_block(fs); in main()
737 list_bad_blocks(fs, 0); in main()
741 fs->flags &= ~EXT2_FLAG_IGNORE_CSUM_ERRORS; in main()
743 retval = ext2fs_read_bitmaps(fs); in main()
745 fs->flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS; in main()
751 list_desc(fs, grp_only); in main()
760 ext2fs_close_free(&fs); in main()