mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-26 04:07:45 +03:00
Prefer VERIFY0P(n) over VERIFY3P(n, ==, NULL)
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
f7bdd84328
commit
82d6f7b047
@@ -160,7 +160,7 @@ kmem_cache_create(const char *name, size_t bufsize, size_t align,
|
||||
{
|
||||
kmem_cache_t *cache;
|
||||
|
||||
ASSERT3P(vmp, ==, NULL);
|
||||
ASSERT0P(vmp);
|
||||
|
||||
cache = kmem_alloc(sizeof (*cache), KM_SLEEP);
|
||||
strlcpy(cache->kc_name, name, sizeof (cache->kc_name));
|
||||
|
||||
@@ -256,7 +256,7 @@ sysevent_worker(void *arg __unused)
|
||||
* free `ze`, so just inline the free() here -- events have already
|
||||
* been drained.
|
||||
*/
|
||||
VERIFY3P(ze->ze_zevent, ==, NULL);
|
||||
VERIFY0P(ze->ze_zevent);
|
||||
kmem_free(ze, sizeof (zfs_zevent_t));
|
||||
|
||||
kthread_exit();
|
||||
|
||||
@@ -507,7 +507,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);
|
||||
|
||||
/* There's nothing left to advance to, so do nothing */
|
||||
@@ -526,7 +526,7 @@ abd_iter_map(struct abd_iter *aiter)
|
||||
{
|
||||
void *paddr;
|
||||
|
||||
ASSERT3P(aiter->iter_mapaddr, ==, NULL);
|
||||
ASSERT0P(aiter->iter_mapaddr);
|
||||
ASSERT0(aiter->iter_mapsize);
|
||||
|
||||
/* There's nothing left to iterate over, so do nothing */
|
||||
|
||||
@@ -1236,7 +1236,7 @@ vdev_geom_io_done(zio_t *zio)
|
||||
struct bio *bp = zio->io_bio;
|
||||
|
||||
if (zio->io_type != ZIO_TYPE_READ && zio->io_type != ZIO_TYPE_WRITE) {
|
||||
ASSERT3P(bp, ==, NULL);
|
||||
ASSERT0P(bp);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1632,7 +1632,7 @@ zfs_acl_ids_create(znode_t *dzp, int flag, vattr_t *vap, cred_t *cr,
|
||||
if (zfsvfs->z_replay == B_FALSE)
|
||||
ASSERT_VOP_ELOCKED(ZTOV(dzp), __func__);
|
||||
} else
|
||||
ASSERT3P(dzp->z_vnode, ==, NULL);
|
||||
ASSERT0P(dzp->z_vnode);
|
||||
memset(acl_ids, 0, sizeof (zfs_acl_ids_t));
|
||||
acl_ids->z_mode = MAKEIMODE(vap->va_type, vap->va_mode);
|
||||
|
||||
@@ -2014,7 +2014,7 @@ top:
|
||||
|
||||
error = zfs_aclset_common(zp, aclp, cr, tx);
|
||||
ASSERT0(error);
|
||||
ASSERT3P(zp->z_acl_cached, ==, NULL);
|
||||
ASSERT0P(zp->z_acl_cached);
|
||||
zp->z_acl_cached = aclp;
|
||||
|
||||
if (fuid_dirtied)
|
||||
|
||||
@@ -357,7 +357,7 @@ zfsctl_create(zfsvfs_t *zfsvfs)
|
||||
vnode_t *rvp;
|
||||
uint64_t crtime[2];
|
||||
|
||||
ASSERT3P(zfsvfs->z_ctldir, ==, NULL);
|
||||
ASSERT0P(zfsvfs->z_ctldir);
|
||||
|
||||
snapdir = sfs_alloc_node(sizeof (*snapdir), "snapshot", ZFSCTL_INO_ROOT,
|
||||
ZFSCTL_INO_SNAPDIR);
|
||||
@@ -1367,7 +1367,7 @@ zfsctl_snapshot_unmount(const char *snapname, int flags __unused)
|
||||
|
||||
int err = getzfsvfs(snapname, &zfsvfs);
|
||||
if (err != 0) {
|
||||
ASSERT3P(zfsvfs, ==, NULL);
|
||||
ASSERT0P(zfsvfs);
|
||||
return (0);
|
||||
}
|
||||
vfsp = zfsvfs->z_vfs;
|
||||
|
||||
@@ -1091,7 +1091,7 @@ zfsvfs_setup(zfsvfs_t *zfsvfs, boolean_t mounting)
|
||||
if (mounting) {
|
||||
boolean_t readonly;
|
||||
|
||||
ASSERT3P(zfsvfs->z_kstat.dk_kstats, ==, NULL);
|
||||
ASSERT0P(zfsvfs->z_kstat.dk_kstats);
|
||||
error = dataset_kstats_create(&zfsvfs->z_kstat, zfsvfs->z_os);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
@@ -1101,7 +1101,7 @@ zfs_create(znode_t *dzp, const char *name, vattr_t *vap, int excl, int mode,
|
||||
zfs_exit(zfsvfs, FTAG);
|
||||
return (error);
|
||||
}
|
||||
ASSERT3P(zp, ==, NULL);
|
||||
ASSERT0P(zp);
|
||||
|
||||
/*
|
||||
* Create a new file object and update the directory
|
||||
@@ -1482,7 +1482,7 @@ zfs_mkdir(znode_t *dzp, const char *dirname, vattr_t *vap, znode_t **zpp,
|
||||
zfs_exit(zfsvfs, FTAG);
|
||||
return (error);
|
||||
}
|
||||
ASSERT3P(zp, ==, NULL);
|
||||
ASSERT0P(zp);
|
||||
|
||||
if ((error = zfs_zaccess(dzp, ACE_ADD_SUBDIRECTORY, 0, B_FALSE, cr,
|
||||
mnt_ns))) {
|
||||
|
||||
@@ -161,15 +161,15 @@ zfs_znode_cache_destructor(void *buf, void *arg)
|
||||
znode_t *zp = buf;
|
||||
|
||||
ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs));
|
||||
ASSERT3P(zp->z_vnode, ==, NULL);
|
||||
ASSERT0P(zp->z_vnode);
|
||||
ASSERT(!list_link_active(&zp->z_link_node));
|
||||
mutex_destroy(&zp->z_lock);
|
||||
mutex_destroy(&zp->z_acl_lock);
|
||||
rw_destroy(&zp->z_xattr_lock);
|
||||
zfs_rangelock_fini(&zp->z_rangelock);
|
||||
|
||||
ASSERT3P(zp->z_acl_cached, ==, NULL);
|
||||
ASSERT3P(zp->z_xattr_cached, ==, NULL);
|
||||
ASSERT0P(zp->z_acl_cached);
|
||||
ASSERT0P(zp->z_xattr_cached);
|
||||
}
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ zfs_znode_init(void)
|
||||
/*
|
||||
* Initialize zcache
|
||||
*/
|
||||
ASSERT3P(znode_uma_zone, ==, NULL);
|
||||
ASSERT0P(znode_uma_zone);
|
||||
znode_uma_zone = uma_zcreate("zfs_znode_cache",
|
||||
sizeof (znode_t), zfs_znode_cache_constructor_smr,
|
||||
zfs_znode_cache_destructor_smr, NULL, NULL, 0, 0);
|
||||
@@ -224,7 +224,7 @@ zfs_znode_init(void)
|
||||
/*
|
||||
* Initialize zcache
|
||||
*/
|
||||
ASSERT3P(znode_cache, ==, NULL);
|
||||
ASSERT0P(znode_cache);
|
||||
znode_cache = kmem_cache_create("zfs_znode_cache",
|
||||
sizeof (znode_t), 0, zfs_znode_cache_constructor,
|
||||
zfs_znode_cache_destructor, NULL, NULL, NULL, KMC_RECLAIMABLE);
|
||||
@@ -353,8 +353,8 @@ zfs_znode_sa_init(zfsvfs_t *zfsvfs, znode_t *zp,
|
||||
ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs) || (zfsvfs == zp->z_zfsvfs));
|
||||
ASSERT(MUTEX_HELD(ZFS_OBJ_MUTEX(zfsvfs, zp->z_id)));
|
||||
|
||||
ASSERT3P(zp->z_sa_hdl, ==, NULL);
|
||||
ASSERT3P(zp->z_acl_cached, ==, NULL);
|
||||
ASSERT0P(zp->z_sa_hdl);
|
||||
ASSERT0P(zp->z_acl_cached);
|
||||
if (sa_hdl == NULL) {
|
||||
VERIFY0(sa_handle_get_from_db(zfsvfs->z_os, db, zp,
|
||||
SA_HDL_SHARED, &zp->z_sa_hdl));
|
||||
@@ -1127,7 +1127,7 @@ zfs_rezget(znode_t *zp)
|
||||
}
|
||||
rw_exit(&zp->z_xattr_lock);
|
||||
|
||||
ASSERT3P(zp->z_sa_hdl, ==, NULL);
|
||||
ASSERT0P(zp->z_sa_hdl);
|
||||
err = sa_buf_hold(zfsvfs->z_os, obj_num, NULL, &db);
|
||||
if (err) {
|
||||
ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num);
|
||||
@@ -1298,7 +1298,7 @@ zfs_znode_free(znode_t *zp)
|
||||
zfsvfs_t *zfsvfs = zp->z_zfsvfs;
|
||||
char *symlink;
|
||||
|
||||
ASSERT3P(zp->z_sa_hdl, ==, NULL);
|
||||
ASSERT0P(zp->z_sa_hdl);
|
||||
zp->z_vnode = NULL;
|
||||
mutex_enter(&zfsvfs->z_znodes_lock);
|
||||
POINTER_INVALIDATE(&zp->z_zfsvfs);
|
||||
|
||||
@@ -1415,7 +1415,7 @@ zvol_os_free(zvol_state_t *zv)
|
||||
struct zvol_state_geom *zsg = &zv->zv_zso->zso_geom;
|
||||
struct g_provider *pp __maybe_unused = zsg->zsg_provider;
|
||||
|
||||
ASSERT3P(pp->private, ==, NULL);
|
||||
ASSERT0P(pp->private);
|
||||
|
||||
g_topology_lock();
|
||||
zvol_geom_destroy(zv);
|
||||
@@ -1425,7 +1425,7 @@ zvol_os_free(zvol_state_t *zv)
|
||||
struct cdev *dev = zsd->zsd_cdev;
|
||||
|
||||
if (dev != NULL) {
|
||||
ASSERT3P(dev->si_drv2, ==, NULL);
|
||||
ASSERT0P(dev->si_drv2);
|
||||
destroy_dev(dev);
|
||||
knlist_clear(&zsd->zsd_selinfo.si_note, 0);
|
||||
knlist_destroy(&zsd->zsd_selinfo.si_note);
|
||||
@@ -1493,11 +1493,11 @@ zvol_os_create_minor(const char *name)
|
||||
|
||||
zv->zv_objset = os;
|
||||
|
||||
ASSERT3P(zv->zv_kstat.dk_kstats, ==, NULL);
|
||||
ASSERT0P(zv->zv_kstat.dk_kstats);
|
||||
error = dataset_kstats_create(&zv->zv_kstat, zv->zv_objset);
|
||||
if (error)
|
||||
goto out_dmu_objset_disown;
|
||||
ASSERT3P(zv->zv_zilog, ==, NULL);
|
||||
ASSERT0P(zv->zv_zilog);
|
||||
zv->zv_zilog = zil_open(os, zvol_get_data, &zv->zv_kstat.dk_zil_sums);
|
||||
if (spa_writeable(dmu_objset_spa(os))) {
|
||||
if (zil_replay_disable)
|
||||
|
||||
Reference in New Issue
Block a user