void do_show_super_stats(int argc, char *argv[])
{
+ const char *units ="block";
dgrp_t i;
FILE *out;
int c, header_only = 0;
return;
out = open_pager();
+ if (EXT2_HAS_RO_COMPAT_FEATURE(current_fs->super,
+ EXT4_FEATURE_RO_COMPAT_BIGALLOC))
+ units = "cluster";
+
list_super2(current_fs->super, out);
for (i=0; i < current_fs->group_desc_count; i++)
numdirs += ext2fs_bg_used_dirs_count(current_fs, i);
fprintf(out, " Group %2d: block bitmap at %llu, "
"inode bitmap at %llu, "
"inode table at %llu\n"
- " %u free %s, "
+ " %u free %s%s, "
"%u free %s, "
"%u used %s%s",
i, ext2fs_block_bitmap_loc(current_fs, i),
ext2fs_inode_bitmap_loc(current_fs, i),
ext2fs_inode_table_loc(current_fs, i),
- ext2fs_bg_free_blocks_count(current_fs, i),
+ ext2fs_bg_free_blocks_count(current_fs, i), units,
ext2fs_bg_free_blocks_count(current_fs, i) != 1 ?
- "blocks" : "block",
+ "s" : "",
ext2fs_bg_free_inodes_count(current_fs, i),
ext2fs_bg_free_inodes_count(current_fs, i) != 1 ?
"inodes" : "inode",
blk64_t first_block, last_block;
blk64_t super_blk, old_desc_blk, new_desc_blk;
char *block_bitmap=NULL, *inode_bitmap=NULL;
+ const char *units = _("blocks");
int inode_blocks_per_group, old_desc_blocks, reserved_gdt;
int block_nbytes, inode_nbytes;
int has_super;
blk64_t blk_itr = EXT2FS_B2C(fs, fs->super->s_first_data_block);
ext2_ino_t ino_itr = 1;
+ if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
+ EXT4_FEATURE_RO_COMPAT_BIGALLOC))
+ units = _("clusters");
+
block_nbytes = EXT2_CLUSTERS_PER_GROUP(fs->super) / 8;
inode_nbytes = EXT2_INODES_PER_GROUP(fs->super) / 8;
inode_blocks_per_group - 1);
print_bg_rel_offset(fs, ext2fs_inode_table_loc(fs, i), 1,
first_block, last_block);
- printf (_("\n %u free blocks, %u free inodes, "
+ printf (_("\n %u free %s, %u free inodes, "
"%u directories%s"),
- ext2fs_bg_free_blocks_count(fs, i),
+ ext2fs_bg_free_blocks_count(fs, i), units,
ext2fs_bg_free_inodes_count(fs, i),
ext2fs_bg_used_dirs_count(fs, i),
ext2fs_bg_itable_unused(fs, i) ? "" : "\n");