FreeBSD: Clean up ASSERT/VERIFY use in module

Convert use of ASSERT() to ASSERT0(), ASSERT3U(), ASSERT3S(), 
ASSERT3P(), and likewise for VERIFY().  In some cases it ended up 
making more sense to change the code, such as VERIFY on nvlist 
operations that I have converted to use fnvlist instead.  In one 
place I changed an internal struct member from int to boolean_t to 
match its use.  Some asserts that combined multiple checks with && 
in a single assert have been split to separate asserts, to make it 
apparent which check fails.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11971
This commit is contained in:
Ryan Moeller
2021-04-30 19:36:10 -04:00
committed by GitHub
parent ec4f330816
commit e4efb70950
23 changed files with 233 additions and 238 deletions
+3 -3
View File
@@ -112,7 +112,7 @@ zfs_kmem_free(void *buf, size_t size __unused)
if (i == buf)
break;
}
ASSERT(i != NULL);
ASSERT3P(i, !=, NULL);
LIST_REMOVE(i, next);
mtx_unlock(&kmem_items_mtx);
memset(buf, 0xDC, MAX(size, 16));
@@ -162,7 +162,7 @@ kmem_cache_create(char *name, size_t bufsize, size_t align,
{
kmem_cache_t *cache;
ASSERT(vmp == NULL);
ASSERT3P(vmp, ==, NULL);
cache = kmem_alloc(sizeof (*cache), KM_SLEEP);
strlcpy(cache->kc_name, name, sizeof (cache->kc_name));
@@ -324,7 +324,7 @@ void
spl_kmem_cache_set_move(kmem_cache_t *skc,
kmem_cbrc_t (move)(void *, void *, size_t, void *))
{
ASSERT(move != NULL);
ASSERT3P(move, !=, NULL);
}
#ifdef KMEM_DEBUG