Skip to content

Commit 611b95d

Browse files
robnbehlendorf
authored andcommitted
Prefer VERIFY0(n) over VERIFY3S(n, ==, 0)
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes #17591
1 parent 5c7df3b commit 611b95d

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

cmd/ztest.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8978,7 +8978,7 @@ main(int argc, char **argv)
89788978
exit(EXIT_FAILURE);
89798979
} else {
89808980
/* children should not be spawned if setting gvars fails */
8981-
VERIFY3S(err, ==, 0);
8981+
VERIFY0(err);
89828982
}
89838983

89848984
/* Override location of zpool.cache */

module/os/linux/zfs/zfs_znode_os.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz,
611611
* processing so do not hash unlinked znodes.
612612
*/
613613
if (links > 0)
614-
VERIFY3S(insert_inode_locked(ip), ==, 0);
614+
VERIFY0(insert_inode_locked(ip));
615615

616616
mutex_enter(&zfsvfs->z_znodes_lock);
617617
list_insert_tail(&zfsvfs->z_all_znodes, zp);

module/zfs/dsl_bookmark.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ dsl_bookmark_create_check_impl(dsl_pool_t *dp,
243243
/* error is retval of the following if-cascade */
244244
if (strchr(source, '@') != NULL) {
245245
dsl_dataset_t *source_snap_ds;
246-
ASSERT3S(snapshot_namecheck(source, NULL, NULL), ==, 0);
246+
ASSERT0(snapshot_namecheck(source, NULL, NULL));
247247
error = dsl_dataset_hold(dp, source, FTAG, &source_snap_ds);
248248
if (error == 0) {
249249
VERIFY(source_snap_ds->ds_is_snapshot);
@@ -258,7 +258,7 @@ dsl_bookmark_create_check_impl(dsl_pool_t *dp,
258258
}
259259
} else if (strchr(source, '#') != NULL) {
260260
zfs_bookmark_phys_t source_phys;
261-
ASSERT3S(bookmark_namecheck(source, NULL, NULL), ==, 0);
261+
ASSERT0(bookmark_namecheck(source, NULL, NULL));
262262
/*
263263
* Source must exists and be an earlier point in newbm_ds's
264264
* timeline (newbm_ds's origin may be a snap of source's ds)

tests/zfs-tests/cmd/btree_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ insert_find_remove(zfs_btree_t *bt, char *why)
207207
"Found removed value (%llu)\n", *p);
208208
return (1);
209209
}
210-
ASSERT3S(zfs_btree_numnodes(bt), ==, 0);
210+
ASSERT0(zfs_btree_numnodes(bt));
211211
zfs_btree_verify(bt);
212212

213213
return (0);
@@ -279,7 +279,7 @@ drain_tree(zfs_btree_t *bt, char *why)
279279
node = avl_last(&avl);
280280
ASSERT3U(node->data, ==, *(uint64_t *)zfs_btree_last(bt, NULL));
281281
}
282-
ASSERT3S(zfs_btree_numnodes(bt), ==, 0);
282+
ASSERT0(zfs_btree_numnodes(bt));
283283

284284
void *avl_cookie = NULL;
285285
while ((node = avl_destroy_nodes(&avl, &avl_cookie)) != NULL)

0 commit comments

Comments
 (0)