Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions cmd/zdb/zdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ static int
sublivelist_verify_blkptr(void *arg, const blkptr_t *bp, boolean_t free,
dmu_tx_t *tx)
{
ASSERT3P(tx, ==, NULL);
ASSERT0P(tx);
struct sublivelist_verify *sv = arg;
sublivelist_verify_block_refcnt_t current = {
.svbr_blk = *bp,
Expand Down Expand Up @@ -892,9 +892,9 @@ dump_packed_nvlist(objset_t *os, uint64_t object, void *data, size_t size)
size_t nvsize = *(uint64_t *)data;
char *packed = umem_alloc(nvsize, UMEM_NOFAIL);

VERIFY(0 == dmu_read(os, object, 0, nvsize, packed, DMU_READ_PREFETCH));
VERIFY0(dmu_read(os, object, 0, nvsize, packed, DMU_READ_PREFETCH));

VERIFY(nvlist_unpack(packed, nvsize, &nv, 0) == 0);
VERIFY0(nvlist_unpack(packed, nvsize, &nv, 0));

umem_free(packed, nvsize);

Expand Down Expand Up @@ -1455,8 +1455,8 @@ get_obsolete_refcount(vdev_t *vd)
refcount++;
}
} else {
ASSERT3P(vd->vdev_obsolete_sm, ==, NULL);
ASSERT3U(obsolete_sm_object, ==, 0);
ASSERT0P(vd->vdev_obsolete_sm);
ASSERT0(obsolete_sm_object);
}
for (unsigned c = 0; c < vd->vdev_children; c++) {
refcount += get_obsolete_refcount(vd->vdev_child[c]);
Expand Down Expand Up @@ -1792,7 +1792,7 @@ print_vdev_indirect(vdev_t *vd)
vdev_indirect_births_t *vib = vd->vdev_indirect_births;

if (vim == NULL) {
ASSERT3P(vib, ==, NULL);
ASSERT0P(vib);
return;
}

Expand Down Expand Up @@ -2043,10 +2043,10 @@ dump_ddt_object(ddt_t *ddt, ddt_type_t type, ddt_class_t class)

if (error == ENOENT)
return;
ASSERT(error == 0);
ASSERT0(error);

error = ddt_object_count(ddt, type, class, &count);
ASSERT(error == 0);
ASSERT0(error);
if (count == 0)
return;

Expand Down Expand Up @@ -3109,7 +3109,7 @@ dsl_deadlist_entry_count_refd(void *arg, dsl_deadlist_entry_t *dle)
static int
dsl_deadlist_entry_dump(void *arg, dsl_deadlist_entry_t *dle)
{
ASSERT(arg == NULL);
ASSERT0P(arg);
if (dump_opt['d'] >= 5) {
char buf[128];
(void) snprintf(buf, sizeof (buf),
Expand Down Expand Up @@ -3347,7 +3347,7 @@ open_objset(const char *path, const void *tag, objset_t **osp)
uint64_t sa_attrs = 0;
uint64_t version = 0;

VERIFY3P(sa_os, ==, NULL);
VERIFY0P(sa_os);

/*
* We can't own an objset if it's redacted. Therefore, we do this
Expand Down Expand Up @@ -3520,8 +3520,8 @@ dump_uidgid(objset_t *os, uint64_t uid, uint64_t gid)
uint64_t fuid_obj;

/* first find the fuid object. It lives in the master node */
VERIFY(zap_lookup(os, MASTER_NODE_OBJ, ZFS_FUID_TABLES,
8, 1, &fuid_obj) == 0);
VERIFY0(zap_lookup(os, MASTER_NODE_OBJ, ZFS_FUID_TABLES,
8, 1, &fuid_obj));
zfs_fuid_avl_tree_create(&idx_tree, &domain_tree);
(void) zfs_fuid_table_load(os, fuid_obj,
&idx_tree, &domain_tree);
Expand Down Expand Up @@ -7016,7 +7016,7 @@ deleted_livelists_count_blocks(spa_t *spa, zdb_cb_t *zbc)
static void
dump_livelist_cb(dsl_deadlist_t *ll, void *arg)
{
ASSERT3P(arg, ==, NULL);
ASSERT0P(arg);
global_feature_count[SPA_FEATURE_LIVELIST]++;
dump_blkptr_list(ll, "Deleted Livelist");
dsl_deadlist_iterate(ll, sublivelist_verify_lightweight, NULL);
Expand Down Expand Up @@ -7913,7 +7913,7 @@ verify_checkpoint_vdev_spacemaps(spa_t *checkpoint, spa_t *current)
for (uint64_t c = ckpoint_rvd->vdev_children;
c < current_rvd->vdev_children; c++) {
vdev_t *current_vd = current_rvd->vdev_child[c];
VERIFY3P(current_vd->vdev_checkpoint_sm, ==, NULL);
VERIFY0P(current_vd->vdev_checkpoint_sm);
}
}

Expand Down Expand Up @@ -9743,7 +9743,7 @@ main(int argc, char **argv)
if (error == 0) {
if (dump_opt['k'] && (target_is_spa || dump_opt['R'])) {
ASSERT(checkpoint_pool != NULL);
ASSERT(checkpoint_target == NULL);
ASSERT0P(checkpoint_target);

error = spa_open(checkpoint_pool, &spa, FTAG);
if (error != 0) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/zfs/zfs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ zfs_do_clone(int argc, char **argv)
return (!!ret);

usage:
ASSERT3P(zhp, ==, NULL);
ASSERT0P(zhp);
nvlist_free(props);
usage(B_FALSE);
return (-1);
Expand Down
10 changes: 5 additions & 5 deletions cmd/zhack.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ zhack_import(char *target, boolean_t readonly)

props = NULL;
if (readonly) {
VERIFY(nvlist_alloc(&props, NV_UNIQUE_NAME, 0) == 0);
VERIFY(nvlist_add_uint64(props,
zpool_prop_to_name(ZPOOL_PROP_READONLY), 1) == 0);
VERIFY0(nvlist_alloc(&props, NV_UNIQUE_NAME, 0));
VERIFY0(nvlist_add_uint64(props,
zpool_prop_to_name(ZPOOL_PROP_READONLY), 1));
}

zfeature_checks_disable = B_TRUE;
Expand Down Expand Up @@ -218,8 +218,8 @@ dump_obj(objset_t *os, uint64_t obj, const char *name)
} else {
ASSERT(za->za_integer_length == 1);
char val[1024];
VERIFY(zap_lookup(os, obj, za->za_name,
1, sizeof (val), val) == 0);
VERIFY0(zap_lookup(os, obj, za->za_name,
1, sizeof (val), val));
(void) printf("\t%s = %s\n", za->za_name, val);
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/zpool/zpool_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12374,7 +12374,7 @@ zpool_do_events_next(ev_opts_t *opts)
nvlist_free(nvl);
}

VERIFY(0 == close(zevent_fd));
VERIFY0(close(zevent_fd));

return (ret);
}
Expand Down
20 changes: 10 additions & 10 deletions cmd/ztest.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,8 +829,8 @@ static char *short_opts = NULL;
static void
init_options(void)
{
ASSERT3P(long_opts, ==, NULL);
ASSERT3P(short_opts, ==, NULL);
ASSERT0P(long_opts);
ASSERT0P(short_opts);

int count = sizeof (option_table) / sizeof (option_table[0]);
long_opts = umem_alloc(sizeof (struct option) * count, UMEM_NOFAIL);
Expand Down Expand Up @@ -1686,7 +1686,7 @@ ztest_rll_init(rll_t *rll)
static void
ztest_rll_destroy(rll_t *rll)
{
ASSERT3P(rll->rll_writer, ==, NULL);
ASSERT0P(rll->rll_writer);
ASSERT0(rll->rll_readers);
mutex_destroy(&rll->rll_lock);
cv_destroy(&rll->rll_cv);
Expand Down Expand Up @@ -1720,7 +1720,7 @@ ztest_rll_unlock(rll_t *rll)
rll->rll_writer = NULL;
} else {
ASSERT3S(rll->rll_readers, >, 0);
ASSERT3P(rll->rll_writer, ==, NULL);
ASSERT0P(rll->rll_writer);
rll->rll_readers--;
}

Expand Down Expand Up @@ -2278,8 +2278,8 @@ ztest_replay_write(void *arg1, void *arg2, boolean_t byteswap)

ztest_block_tag_t rbt;

VERIFY(dmu_read(os, lr->lr_foid, offset,
sizeof (rbt), &rbt, flags) == 0);
VERIFY0(dmu_read(os, lr->lr_foid, offset,
sizeof (rbt), &rbt, flags));
if (rbt.bt_magic == BT_MAGIC) {
ztest_bt_verify(&rbt, os, lr->lr_foid, 0,
offset, gen, txg, crtxg);
Expand Down Expand Up @@ -4007,7 +4007,7 @@ raidz_scratch_verify(void)
* requested by user, but scratch object was not created.
*/
case RRSS_SCRATCH_NOT_IN_USE:
ASSERT3U(offset, ==, 0);
ASSERT0(offset);
break;

/*
Expand Down Expand Up @@ -5537,8 +5537,8 @@ ztest_dmu_read_write_zcopy(ztest_ds_t *zd, uint64_t id)
}

if (i == 1) {
VERIFY(dmu_buf_hold(os, bigobj, off,
FTAG, &dbt, DMU_READ_NO_PREFETCH) == 0);
VERIFY0(dmu_buf_hold(os, bigobj, off,
FTAG, &dbt, DMU_READ_NO_PREFETCH));
}
if (i != 5 || chunksize < (SPA_MINBLOCKSIZE * 2)) {
VERIFY0(dmu_assign_arcbuf_by_dbuf(bonus_db,
Expand Down Expand Up @@ -8979,7 +8979,7 @@ main(int argc, char **argv)
exit(EXIT_FAILURE);
} else {
/* children should not be spawned if setting gvars fails */
VERIFY3S(err, ==, 0);
VERIFY0(err);
}

/* Override location of zpool.cache */
Expand Down
4 changes: 2 additions & 2 deletions include/os/freebsd/spl/sys/proc.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ do_thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg,
/*
* Be sure there are no surprises.
*/
ASSERT(stk == NULL);
ASSERT(len == 0);
ASSERT0P(stk);
ASSERT0(len);
ASSERT(state == TS_RUN);

if (pp == &p0)
Expand Down
2 changes: 1 addition & 1 deletion include/os/linux/spl/sys/mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ spl_mutex_lockdep_on_maybe(kmutex_t *mp) \
#undef mutex_destroy
#define mutex_destroy(mp) \
{ \
VERIFY3P(mutex_owner(mp), ==, NULL); \
VERIFY0P(mutex_owner(mp)); \
}

#define mutex_tryenter(mp) \
Expand Down
4 changes: 2 additions & 2 deletions include/sys/dmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,8 @@ dmu_buf_init_user(dmu_buf_user_t *dbu, dmu_buf_evict_func_t *evict_func_sync,
dmu_buf_evict_func_t *evict_func_async,
dmu_buf_t **clear_on_evict_dbufp __maybe_unused)
{
ASSERT(dbu->dbu_evict_func_sync == NULL);
ASSERT(dbu->dbu_evict_func_async == NULL);
ASSERT0P(dbu->dbu_evict_func_sync);
ASSERT0P(dbu->dbu_evict_func_async);

/* must have at least one evict func */
IMPLY(evict_func_sync == NULL, evict_func_async != NULL);
Expand Down
2 changes: 1 addition & 1 deletion include/sys/zfs_znode.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ extern "C" {
pflags |= attr; \
else \
pflags &= ~attr; \
VERIFY(0 == sa_update(zp->z_sa_hdl, SA_ZPL_FLAGS(ZTOZSB(zp)), \
VERIFY0(sa_update(zp->z_sa_hdl, SA_ZPL_FLAGS(ZTOZSB(zp)), \
&pflags, sizeof (pflags), tx)); \
}

Expand Down
4 changes: 2 additions & 2 deletions lib/libzfs/libzfs_diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ get_stats_for_obj(differ_info_t *di, const char *dsname, uint64_t obj,
/* we can get stats even if we failed to get a path */
(void) memcpy(sb, &zc.zc_stat, sizeof (zfs_stat_t));
if (error == 0) {
ASSERT(di->zerr == 0);
ASSERT0(di->zerr);
(void) strlcpy(pn, zc.zc_value, maxlen);
return (0);
}
Expand Down Expand Up @@ -404,7 +404,7 @@ write_free_diffs(FILE *fp, differ_info_t *di, dmu_diff_record_t *dr)
(void) strlcpy(zc.zc_name, di->fromsnap, sizeof (zc.zc_name));
zc.zc_obj = dr->ddr_first - 1;

ASSERT(di->zerr == 0);
ASSERT0(di->zerr);

while (zc.zc_obj < dr->ddr_last) {
int err;
Expand Down
2 changes: 1 addition & 1 deletion lib/libzfs/libzfs_import.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const pool_config_ops_t libzfs_config_ops = {
static uint64_t
label_offset(uint64_t size, int l)
{
ASSERT(P2PHASE_TYPED(size, sizeof (vdev_label_t), uint64_t) == 0);
ASSERT0(P2PHASE_TYPED(size, sizeof (vdev_label_t), uint64_t));
return (l * sizeof (vdev_label_t) + (l < VDEV_LABELS / 2 ?
0 : size - VDEV_LABELS * sizeof (vdev_label_t)));
}
Expand Down
2 changes: 1 addition & 1 deletion lib/libzfs/libzfs_mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ zfs_mount_at(zfs_handle_t *zhp, const char *options, int flags,
} else if (rc == ENOTSUP) {
int spa_version;

VERIFY(zfs_spa_version(zhp, &spa_version) == 0);
VERIFY0(zfs_spa_version(zhp, &spa_version));
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"Can't mount a version %llu "
"file system on a version %d pool. Pool must be"
Expand Down
8 changes: 4 additions & 4 deletions lib/libzfs/libzfs_sendrecv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2505,7 +2505,7 @@ zfs_send_cb_impl(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
err = ENOENT;

if (sdd.cleanup_fd != -1) {
VERIFY(0 == close(sdd.cleanup_fd));
VERIFY0(close(sdd.cleanup_fd));
sdd.cleanup_fd = -1;
}

Expand All @@ -2531,7 +2531,7 @@ zfs_send_cb_impl(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
fnvlist_free(sdd.snapholds);

if (sdd.cleanup_fd != -1)
VERIFY(0 == close(sdd.cleanup_fd));
VERIFY0(close(sdd.cleanup_fd));
return (err);
}

Expand Down Expand Up @@ -5108,7 +5108,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
nvlist_t *holds, *errors = NULL;
int cleanup_fd = -1;

VERIFY(0 == nvlist_alloc(&holds, 0, KM_SLEEP));
VERIFY0(nvlist_alloc(&holds, 0, KM_SLEEP));
for (pair = nvlist_next_nvpair(snapholds_nvlist, NULL);
pair != NULL;
pair = nvlist_next_nvpair(snapholds_nvlist, pair)) {
Expand Down Expand Up @@ -5560,7 +5560,7 @@ zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap,
if ((cp = strchr(nonpackage_sendfs, '@')) != NULL)
*cp = '\0';
sendfs = nonpackage_sendfs;
VERIFY(finalsnap == NULL);
VERIFY0P(finalsnap);
}
return (zfs_receive_one(hdl, infd, tosnap, originsnap, flags,
&drr, &drr_noswap, sendfs, stream_nv, stream_avl, top_zfs,
Expand Down
4 changes: 2 additions & 2 deletions lib/libzpool/abd_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ abd_iter_at_end(struct abd_iter *aiter)
void
abd_iter_advance(struct abd_iter *aiter, size_t amount)
{
ASSERT3P(aiter->iter_mapaddr, ==, NULL);
ASSERT0P(aiter->iter_mapaddr);
ASSERT0(aiter->iter_mapsize);

if (abd_iter_at_end(aiter))
Expand All @@ -315,7 +315,7 @@ abd_iter_advance(struct abd_iter *aiter, size_t amount)
void
abd_iter_map(struct abd_iter *aiter)
{
ASSERT3P(aiter->iter_mapaddr, ==, NULL);
ASSERT0P(aiter->iter_mapaddr);
ASSERT0(aiter->iter_mapsize);

if (abd_iter_at_end(aiter))
Expand Down
2 changes: 1 addition & 1 deletion lib/libzpool/kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ cv_timedwait(kcondvar_t *cv, kmutex_t *mp, clock_t abstime)
if (delta <= 0)
return (-1);

VERIFY(gettimeofday(&tv, NULL) == 0);
VERIFY0(gettimeofday(&tv, NULL));

ts.tv_sec = tv.tv_sec + delta / hz;
ts.tv_nsec = tv.tv_usec * NSEC_PER_USEC + (delta % hz) * (NANOSEC / hz);
Expand Down
8 changes: 3 additions & 5 deletions lib/libzpool/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,10 @@ show_pool_stats(spa_t *spa)
nvlist_t *config, *nvroot;
const char *name;

VERIFY(spa_get_stats(spa_name(spa), &config, NULL, 0) == 0);
VERIFY0(spa_get_stats(spa_name(spa), &config, NULL, 0));

VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
&nvroot) == 0);
VERIFY(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME,
&name) == 0);
VERIFY0(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, &nvroot));
VERIFY0(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME, &name));

show_vdev_stats(name, ZPOOL_CONFIG_CHILDREN, nvroot, 0);
show_vdev_stats(NULL, ZPOOL_CONFIG_L2CACHE, nvroot, 0);
Expand Down
4 changes: 2 additions & 2 deletions lib/libzutil/zutil_import.c
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ get_configs(libpc_handle_t *hdl, pool_list_t *pl, boolean_t active_ok,
static uint64_t
label_offset(uint64_t size, int l)
{
ASSERT(P2PHASE_TYPED(size, sizeof (vdev_label_t), uint64_t) == 0);
ASSERT0(P2PHASE_TYPED(size, sizeof (vdev_label_t), uint64_t));
return (l * sizeof (vdev_label_t) + (l < VDEV_LABELS / 2 ?
0 : size - VDEV_LABELS * sizeof (vdev_label_t)));
}
Expand Down Expand Up @@ -1769,7 +1769,7 @@ zpool_find_import_cached(libpc_handle_t *hdl, importargs_t *iarg)
fnvlist_add_nvlist(pools, nvpair_name(pair),
fnvpair_value_nvlist(pair));

VERIFY3P(nvlist_next_nvpair(nv, pair), ==, NULL);
VERIFY0P(nvlist_next_nvpair(nv, pair));

iarg->guid = saved_guid;
iarg->poolname = saved_poolname;
Expand Down
Loading