mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +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
@@ -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);
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -2531,7 +2531,7 @@ err_out:
|
||||
fnvlist_free(sdd.snapholds);
|
||||
|
||||
if (sdd.cleanup_fd != -1)
|
||||
VERIFY(0 == close(sdd.cleanup_fd));
|
||||
VERIFY0(close(sdd.cleanup_fd));
|
||||
return (err);
|
||||
}
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user