summaryrefslogtreecommitdiff
path: root/ext2fs
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-08-15 02:22:18 +0000
committerMiles Bader <miles@gnu.org>1996-08-15 02:22:18 +0000
commitd7f2b3d06e56f236ec9d1948d4d0989deeaa2132 (patch)
treeb4f21785c32a1c1d10a6be529bee48bdad7cf48b /ext2fs
parent3cdda33ced2cc5250a1e905afeaede8f48970bb7 (diff)
(get_hypermetadata):
Use EXT2_INODE_SIZE instead of sizeof (struct ext2_inode). Deal with various version 2.x features.
Diffstat (limited to 'ext2fs')
-rw-r--r--ext2fs/hyper.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/ext2fs/hyper.c b/ext2fs/hyper.c
index 293574a6..22864bbb 100644
--- a/ext2fs/hyper.c
+++ b/ext2fs/hyper.c
@@ -107,7 +107,7 @@ get_hypermetadata (void)
sblock->s_blocks_count << log2_dev_blocks_per_fs_block);
/* Set these handy variables. */
- inodes_per_block = block_size / sizeof (struct ext2_inode);
+ inodes_per_block = block_size / EXT2_INODE_SIZE (sblock);
frag_size = EXT2_MIN_FRAG_SIZE << sblock->s_log_frag_size;
if (frag_size)
@@ -115,6 +115,23 @@ get_hypermetadata (void)
else
ext2_panic ("frag size is zero!");
+ if (sblock->s_rev_level > EXT2_GOOD_OLD_REV)
+ {
+ if (sblock->s_feature_incompat & ~EXT2_FEATURE_INCOMPAT_SUPP)
+ ext2_panic ("could not mount because of unsupported optional features"
+ " (0x%x)",
+ sblock->s_feature_incompat & ~EXT2_FEATURE_INCOMPAT_SUPP);
+ if (sblock->s_feature_ro_compat & ~EXT2_FEATURE_RO_COMPAT_SUPP)
+ {
+ ext2_warning ("mounted readonly because of"
+ " unsupported optional features (0x%x)",
+ sblock->s_feature_ro_compat & ~EXT2_FEATURE_RO_COMPAT_SUPP);
+ diskfs_readonly = 1;
+ }
+ if (sblock->s_inode_size != EXT2_GOOD_OLD_INODE_SIZE)
+ ext2_panic ("inode size %d isn't supported", sblock->s_inode_size);
+ }
+
groups_count =
((sblock->s_blocks_count - sblock->s_first_data_block +
sblock->s_blocks_per_group - 1)