summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-06-01 16:15:40 -0400
committerTheodore Ts'o <tytso@mit.edu>2009-06-01 16:15:40 -0400
commit0180a05e7449ba3ba6b15f7a5c372f712331cb89 (patch)
tree38f1204cfc49f210e0edd0ff2560cf9907ed8a71 /lib
parent5635e75c918866849746cf50d1a9a301c241fed4 (diff)
downloade2fsprogs-0180a05e7449ba3ba6b15f7a5c372f712331cb89.tar.gz
e2p: Print 64-bit block numbers in the superblock
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'lib')
-rw-r--r--lib/e2p/ls.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/lib/e2p/ls.c b/lib/e2p/ls.c
index eb9a7721..f385fd77 100644
--- a/lib/e2p/ls.c
+++ b/lib/e2p/ls.c
@@ -164,6 +164,26 @@ static void print_super_flags(struct ext2_super_block * s, FILE *f)
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)
@@ -219,9 +239,9 @@ void list_super2(struct ext2_super_block * sb, FILE *f)
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));