mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
Prefer VERIFY0(n) over VERIFY(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
This commit is contained in:
committed by
Brian Behlendorf
parent
2564308cb2
commit
c39e076f23
+6
-6
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
+5
-5
@@ -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;
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12377,7 +12377,7 @@ zpool_do_events_next(ev_opts_t *opts)
|
||||
nvlist_free(nvl);
|
||||
}
|
||||
|
||||
VERIFY(0 == close(zevent_fd));
|
||||
VERIFY0(close(zevent_fd));
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
+4
-4
@@ -2277,8 +2277,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);
|
||||
@@ -5536,8 +5536,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,
|
||||
|
||||
Reference in New Issue
Block a user