On-disk format definition for huge files
- EXT4_FEATURE_RO_COMPAT_HUGE_FILE (0x0008) - change i_blocks to be
in units of s_blocksize units instead of 512-byte sectors, use
l_i_frag and l_i_fsize as i_blocks_hi (could also be part of 64BIT).
E2fsck and debugfs changed to support i_blocks_hi instead of l_i_frag and
l_i_fsize.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index 8d93795..6eba9ae 100644
--- a/debugfs/debugfs.c
+++ b/debugfs/debugfs.c
@@ -541,7 +541,7 @@
fprintf(out, "%lld\n", i_size);
} else
fprintf(out, "%d\n", inode->i_size);
- if (current_fs->super->s_creator_os == EXT2_OS_HURD)
+ if (os == EXT2_OS_HURD)
fprintf(out,
"%sFile ACL: %d Directory ACL: %d Translator: %d\n",
prefix,
@@ -551,13 +551,16 @@
fprintf(out, "%sFile ACL: %d Directory ACL: %d\n",
prefix,
inode->i_file_acl, LINUX_S_ISDIR(inode->i_mode) ? inode->i_dir_acl : 0);
- fprintf(out, "%sLinks: %d Blockcount: %u\n",
- prefix, inode->i_links_count, inode->i_blocks);
+ if (os == EXT2_OS_LINUX)
+ fprintf(out, "%sLinks: %d Blockcount: %llu\n",
+ prefix, inode->i_links_count,
+ (((unsigned long long)
+ inode->osd2.linux2.l_i_blocks_hi << 32)) +
+ inode->i_blocks);
+ else
+ fprintf(out, "%sLinks: %d Blockcount: %u\n",
+ prefix, inode->i_links_count, inode->i_blocks);
switch (os) {
- case EXT2_OS_LINUX:
- frag = inode->osd2.linux2.l_i_frag;
- fsize = inode->osd2.linux2.l_i_fsize;
- break;
case EXT2_OS_HURD:
frag = inode->osd2.hurd2.h_i_frag;
fsize = inode->osd2.hurd2.h_i_fsize;
@@ -867,6 +870,9 @@
modify_u32(argv[0], "Access time", decimal_format, &inode.i_atime);
modify_u32(argv[0], "Deletion time", decimal_format, &inode.i_dtime);
modify_u16(argv[0], "Link count", decimal_format, &inode.i_links_count);
+ if (os == EXT2_OS_LINUX)
+ modify_u16(argv[0], "Block count high", unsignedlong_format,
+ &inode.osd2.linux2.l_i_blocks_hi);
modify_u32(argv[0], "Block count", unsignedlong_format, &inode.i_blocks);
modify_u32(argv[0], "File flags", hex_format, &inode.i_flags);
modify_u32(argv[0], "Generation", hex_format, &inode.i_generation);
@@ -879,16 +885,12 @@
else
modify_u32(argv[0], "High 32bits of size", decimal_format, &inode.i_size_high);
- if (current_fs->super->s_creator_os == EXT2_OS_HURD)
+ if (os == EXT2_OS_HURD)
modify_u32(argv[0], "Translator Block",
decimal_format, &inode.osd1.hurd1.h_i_translator);
modify_u32(argv[0], "Fragment address", decimal_format, &inode.i_faddr);
switch (os) {
- case EXT2_OS_LINUX:
- frag = &inode.osd2.linux2.l_i_frag;
- fsize = &inode.osd2.linux2.l_i_fsize;
- break;
case EXT2_OS_HURD:
frag = &inode.osd2.hurd2.h_i_frag;
fsize = &inode.osd2.hurd2.h_i_fsize;