fputs("(none)\n", f);
}
+static __u64 e2p_blocks_count(struct ext2_super_block *super)
+{
+ return super->s_blocks_count |
+ (super->s_feature_incompat & EXT4_FEATURE_INCOMPAT_64BIT ?
+ (__u64) super->s_blocks_count_hi << 32 : 0);
+}
+
+static __u64 e2p_r_blocks_count(struct ext2_super_block *super)
+{
+ return super->s_r_blocks_count |
+ (super->s_feature_incompat & EXT4_FEATURE_INCOMPAT_64BIT ?
+ (__u64) super->s_r_blocks_count_hi << 32 : 0);
+}
+
+static __u64 e2p_free_blocks_count(struct ext2_super_block *super)
+{
+ return super->s_free_blocks_count |
+ (super->s_feature_incompat & EXT4_FEATURE_INCOMPAT_64BIT ?
+ (__u64) super->s_free_blocks_hi << 32 : 0);
+}
#ifndef EXT2_INODE_SIZE
#define EXT2_INODE_SIZE(s) sizeof(struct ext2_inode)
fprintf(f, "Filesystem OS type: %s\n", str);
free(str);
fprintf(f, "Inode count: %u\n", sb->s_inodes_count);
- fprintf(f, "Block count: %u\n", sb->s_blocks_count);
- fprintf(f, "Reserved block count: %u\n", sb->s_r_blocks_count);
- fprintf(f, "Free blocks: %u\n", sb->s_free_blocks_count);
+ fprintf(f, "Block count: %llu\n", e2p_blocks_count(sb));
+ fprintf(f, "Reserved block count: %llu\n", e2p_r_blocks_count(sb));
+ fprintf(f, "Free blocks: %llu\n", e2p_free_blocks_count(sb));
fprintf(f, "Free inodes: %u\n", sb->s_free_inodes_count);
fprintf(f, "First block: %u\n", sb->s_first_data_block);
fprintf(f, "Block size: %u\n", EXT2_BLOCK_SIZE(sb));