diff options
author | Miles Bader <miles@gnu.org> | 1995-04-16 23:51:31 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1995-04-16 23:51:31 +0000 |
commit | 53829ddd1fc9980fc4a1ca797a711ef28ef48ef5 (patch) | |
tree | add5c21465c9eb3c17848733e2055e4fd03eeca1 /ext2fs | |
parent | 943703d65b330e63d2443b6fac5d46e6829d0b2c (diff) |
Formerly hyper.c.~6~
Diffstat (limited to 'ext2fs')
-rw-r--r-- | ext2fs/hyper.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/ext2fs/hyper.c b/ext2fs/hyper.c index f6bfb8ac..b2ec88a4 100644 --- a/ext2fs/hyper.c +++ b/ext2fs/hyper.c @@ -48,13 +48,21 @@ get_hypermetadata (void) "Block size %ld is too small (min is %ld bytes)", block_size, SBLOCK_SIZE); - assert ((vm_page_size % DEV_BSIZE) == 0); - assert ((block_size % DEV_BSIZE) == 0); - - if (block_size < vm_page_size) - ext2_panic ("get_hypermetadata", - "Block size (%d) isn't a multiple of page size (%ld)", - block_size, vm_page_size); + log2_dev_blocks_per_fs_block = 0; + while ((device_block_size << log2_dev_blocks_per_fs_block) < block_size) + log2_dev_blocks_per_fs_block++; + if ((device_block_size << log2_dev_blocks_per_fs_block) != block_size) + ext2_panic("get_hypermetadata", + "Block size %ld isn't a power-of-two multiple of the device" + " block size (%d)!", + block_size, device_block_size); + + log2_block_size = 0; + while ((1 << log2_block_size) < block_size) + log2_block_size++; + if ((1 << log2_block_size) != block_size) + ext2_panic("get_hypermetadata", + "Block size %ld isn't a power of two!", block_size); /* Set these handy variables. */ inodes_per_block = block_size / sizeof (struct ext2_inode); |