From 438c23ab1c64ea66fdad2400ca852404c4622860 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 7 Oct 1999 20:53:03 +0000 Subject: 1999-10-07 Roland McGrath * rdwr.c (store_read, store_write): Fix asserts in last change. --- libstore/rdwr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libstore') diff --git a/libstore/rdwr.c b/libstore/rdwr.c index 94b0fa24..85d2ba2b 100644 --- a/libstore/rdwr.c +++ b/libstore/rdwr.c @@ -107,7 +107,8 @@ store_write (struct store *store, if (store->flags & STORE_READONLY) return EROFS; /* XXX */ - assert ((len & (block_shift - 1)) == 0); + if (store->block_size != 0) + assert ((len & (store->block_size - 1)) == 0); addr = store_find_first_run (store, addr, &run, &runs_end, &base, &index); if (addr < 0) @@ -183,7 +184,8 @@ store_read (struct store *store, if (addr < 0 || run->start < 0) return EIO; /* Reading from a hole. */ - assert ((amount & (block_shift - 1)) == 0); + if (store->block_size != 0) + assert ((amount & (store->block_size - 1)) == 0); if ((amount >> block_shift) <= run->length - addr) /* The first run has it all... */ -- cgit v1.2.3