Fix noassert builds

Change-Id: I5626950ffa29afe7a0fb9e9144839b311824da92
This commit is contained in:
Lionel Sambuc 2015-09-25 12:22:27 -07:00
parent ba736c7968
commit 81b1f87117
2 changed files with 9 additions and 4 deletions

View file

@ -223,11 +223,10 @@ int lmfs_get_block(struct buf **bpp, dev_t dev, block64_t block, int how)
static void munmap_t(void *a, int len)
{
vir_bytes av = (vir_bytes) a;
assert(a);
assert(a != MAP_FAILED);
assert(!((vir_bytes)a % PAGE_SIZE));
assert(len > 0);
assert(!(av % PAGE_SIZE));
len = roundup(len, PAGE_SIZE);
@ -850,10 +849,13 @@ static void rw_scattered(
static iovec_t iovec[NR_IOREQS];
off_t pos;
unsigned int i, iov_per_block;
#if !defined(NDEBUG)
unsigned int start_in_use = bufs_in_use, start_bufqsize = bufqsize;
#endif /* !defined(NDEBUG) */
if(bufqsize == 0) return;
#if !defined(NDEBUG)
/* for READING, check all buffers on the list are obtained and held
* (count > 0)
*/
@ -872,7 +874,8 @@ static void rw_scattered(
assert(dev != NO_DEV);
assert(fs_block_size > 0);
assert(howmany(fs_block_size, PAGE_SIZE) <= NR_IOREQS);
#endif /* !defined(NDEBUG) */
/* For WRITING, (Shell) sort buffers on lmfs_blocknr.
* For READING, the buffers are already sorted.
*/
@ -966,12 +969,14 @@ static void rw_scattered(
}
}
#if !defined(NDEBUG)
if(rw_flag == READING) {
assert(start_in_use >= start_bufqsize);
/* READING callers assume all bufs are released. */
assert(start_in_use - start_bufqsize == bufs_in_use);
}
#endif /* !defined(NDEBUG) */
}
/*===========================================================================*

View file

@ -324,7 +324,7 @@ void wait_for(endpoint_t who)
/*===========================================================================*
* pipe_suspend *
*===========================================================================*/
void pipe_suspend(struct filp * __unused filp, vir_bytes buf, size_t size)
void pipe_suspend(struct filp * filp __unused, vir_bytes buf, size_t size)
{
/* Take measures to suspend the processing of the present system call.
* Store the parameters to be used upon resuming in the process table.