mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Prefer VERIFY0P(n) over VERIFY(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
611b95da18
commit
f7bdd84328
@@ -66,9 +66,9 @@ void
|
||||
__cv_init(kcondvar_t *cvp, char *name, kcv_type_t type, void *arg)
|
||||
{
|
||||
ASSERT(cvp);
|
||||
ASSERT(name == NULL);
|
||||
ASSERT0P(name);
|
||||
ASSERT(type == CV_DEFAULT);
|
||||
ASSERT(arg == NULL);
|
||||
ASSERT0P(arg);
|
||||
|
||||
cvp->cv_magic = CV_MAGIC;
|
||||
init_waitqueue_head(&cvp->cv_event);
|
||||
@@ -83,7 +83,7 @@ static int
|
||||
cv_destroy_wakeup(kcondvar_t *cvp)
|
||||
{
|
||||
if (!atomic_read(&cvp->cv_waiters) && !atomic_read(&cvp->cv_refs)) {
|
||||
ASSERT(cvp->cv_mutex == NULL);
|
||||
ASSERT0P(cvp->cv_mutex);
|
||||
ASSERT(!waitqueue_active(&cvp->cv_event));
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -679,8 +679,8 @@ spl_kmem_cache_create(const char *name, size_t size, size_t align,
|
||||
/*
|
||||
* Unsupported flags
|
||||
*/
|
||||
ASSERT(vmp == NULL);
|
||||
ASSERT(reclaim == NULL);
|
||||
ASSERT0P(vmp);
|
||||
ASSERT0P(reclaim);
|
||||
|
||||
might_sleep();
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ __thread_create(caddr_t stk, size_t stksize, thread_func_t func,
|
||||
|
||||
/* Option pp is simply ignored */
|
||||
/* Variable stack size unsupported */
|
||||
ASSERT(stk == NULL);
|
||||
ASSERT0P(stk);
|
||||
|
||||
tp = kmem_alloc(sizeof (thread_priv_t), KM_PUSHPAGE);
|
||||
if (tp == NULL)
|
||||
|
||||
@@ -2205,7 +2205,7 @@ top:
|
||||
|
||||
error = zfs_aclset_common(zp, aclp, cr, tx);
|
||||
ASSERT0(error);
|
||||
ASSERT(zp->z_acl_cached == NULL);
|
||||
ASSERT0P(zp->z_acl_cached);
|
||||
zp->z_acl_cached = aclp;
|
||||
|
||||
if (fuid_dirtied)
|
||||
|
||||
@@ -590,7 +590,7 @@ zfsctl_inode_lookup(zfsvfs_t *zfsvfs, uint64_t id,
|
||||
int
|
||||
zfsctl_create(zfsvfs_t *zfsvfs)
|
||||
{
|
||||
ASSERT(zfsvfs->z_ctldir == NULL);
|
||||
ASSERT0P(zfsvfs->z_ctldir);
|
||||
|
||||
zfsvfs->z_ctldir = zfsctl_inode_alloc(zfsvfs, ZFSCTL_INO_ROOT,
|
||||
&zpl_fops_root, &zpl_ops_root, 0);
|
||||
|
||||
@@ -223,7 +223,7 @@ zfs_kobj_add(zfs_mod_kobj_t *zkobj, struct kobject *parent, const char *name)
|
||||
{
|
||||
/* zko_default_group.attrs must be NULL terminated */
|
||||
ASSERT(zkobj->zko_default_group.attrs != NULL);
|
||||
ASSERT(zkobj->zko_default_group.attrs[zkobj->zko_attr_count] == NULL);
|
||||
ASSERT0P(zkobj->zko_default_group.attrs[zkobj->zko_attr_count]);
|
||||
|
||||
kobject_init(&zkobj->zko_kobj, &zkobj->zko_kobj_type);
|
||||
return (kobject_add(&zkobj->zko_kobj, parent, name));
|
||||
|
||||
@@ -178,13 +178,13 @@ zfs_znode_init(void)
|
||||
* backed by kmalloc() when on the Linux slab in order that any
|
||||
* wait_on_bit() operations on the related inode operate properly.
|
||||
*/
|
||||
ASSERT(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_SLAB | KMC_RECLAIMABLE);
|
||||
|
||||
ASSERT(znode_hold_cache == NULL);
|
||||
ASSERT0P(znode_hold_cache);
|
||||
znode_hold_cache = kmem_cache_create("zfs_znode_hold_cache",
|
||||
sizeof (znode_hold_t), 0, zfs_znode_hold_cache_constructor,
|
||||
zfs_znode_hold_cache_destructor, NULL, NULL, NULL, 0);
|
||||
@@ -327,8 +327,8 @@ zfs_znode_sa_init(zfsvfs_t *zfsvfs, znode_t *zp,
|
||||
|
||||
mutex_enter(&zp->z_lock);
|
||||
|
||||
ASSERT(zp->z_sa_hdl == NULL);
|
||||
ASSERT(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));
|
||||
@@ -530,7 +530,7 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz,
|
||||
return (NULL);
|
||||
|
||||
zp = ITOZ(ip);
|
||||
ASSERT(zp->z_dirlocks == NULL);
|
||||
ASSERT0P(zp->z_dirlocks);
|
||||
ASSERT3P(zp->z_acl_cached, ==, NULL);
|
||||
ASSERT3P(zp->z_xattr_cached, ==, NULL);
|
||||
zp->z_unlinked = B_FALSE;
|
||||
@@ -1200,7 +1200,7 @@ zfs_rezget(znode_t *zp)
|
||||
}
|
||||
rw_exit(&zp->z_xattr_lock);
|
||||
|
||||
ASSERT(zp->z_sa_hdl == NULL);
|
||||
ASSERT0P(zp->z_sa_hdl);
|
||||
err = sa_buf_hold(zfsvfs->z_os, obj_num, NULL, &db);
|
||||
if (err) {
|
||||
zfs_znode_hold_exit(zfsvfs, zh);
|
||||
|
||||
Reference in New Issue
Block a user