diff options
author | Miles Bader <miles@gnu.org> | 1997-07-24 21:43:21 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1997-07-24 21:43:21 +0000 |
commit | 248a3fd7258aed0f4b2ee120de2b7f236de0a333 (patch) | |
tree | c7e5322ef18500099fd4b0120b48e28dfa84b935 | |
parent | 58424393298983451c3fd37f5adcc7dc1d9ef9fe (diff) |
(_store_derive):
Let BSIZE be zero.
-rw-r--r-- | libstore/derive.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/libstore/derive.c b/libstore/derive.c index dc0d271b..8c0b2790 100644 --- a/libstore/derive.c +++ b/libstore/derive.c @@ -68,15 +68,17 @@ _store_derive (struct store *store) store->size = store->end * bsize; - /* LOG2_BLOCK_SIZE */ store->log2_block_size = 0; - while ((1 << store->log2_block_size) < bsize) - store->log2_block_size++; - assert ((1 << store->log2_block_size) == bsize); - - /* LOG2_BLOCKS_PER_PAGE */ store->log2_blocks_per_page = 0; - while ((bsize << store->log2_blocks_per_page) < vm_page_size) - store->log2_blocks_per_page++; - assert ((bsize << store->log2_blocks_per_page) == vm_page_size); + + if (bsize != 0) + { + while ((1 << store->log2_block_size) < bsize) + store->log2_block_size++; + assert ((1 << store->log2_block_size) == bsize); + + while ((bsize << store->log2_blocks_per_page) < vm_page_size) + store->log2_blocks_per_page++; + assert ((bsize << store->log2_blocks_per_page) == vm_page_size); + } } |