Print this page
3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first argument is zero

@@ -18,12 +18,16 @@
  *
  * CDDL HEADER END
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012 by Delphix. All rights reserved.
  */
 
+
+
+
 /* Portions Copyright 2007 Jeremy Teo */
 /* Portions Copyright 2010 Robert Milkowski */
 
 #include <sys/types.h>
 #include <sys/param.h>

@@ -1639,11 +1643,11 @@
         /* are there any extended attributes? */
         error = sa_lookup(zp->z_sa_hdl, SA_ZPL_XATTR(zfsvfs),
             &xattr_obj, sizeof (xattr_obj));
         if (error == 0 && xattr_obj) {
                 error = zfs_zget(zfsvfs, xattr_obj, &xzp);
-                ASSERT3U(error, ==, 0);
+                ASSERT0(error);
                 dmu_tx_hold_sa(tx, zp->z_sa_hdl, B_TRUE);
                 dmu_tx_hold_sa(tx, xzp->z_sa_hdl, B_FALSE);
         }
 
         mutex_enter(&zp->z_lock);

@@ -1717,15 +1721,15 @@
                                     SA_ZPL_XATTR(zfsvfs), tx);
                         else
                                 error = sa_update(zp->z_sa_hdl,
                                     SA_ZPL_XATTR(zfsvfs), &null_xattr,
                                     sizeof (uint64_t), tx);
-                        ASSERT3U(error, ==, 0);
+                        ASSERT0(error);
                 }
                 mutex_enter(&vp->v_lock);
                 vp->v_count--;
-                ASSERT3U(vp->v_count, ==, 0);
+                ASSERT0(vp->v_count);
                 mutex_exit(&vp->v_lock);
                 mutex_exit(&zp->z_lock);
                 zfs_znode_delete(zp, tx);
         } else if (unlinked) {
                 mutex_exit(&zp->z_lock);

@@ -3094,11 +3098,11 @@
                 SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_MODE(zfsvfs), NULL,
                     &new_mode, sizeof (new_mode));
                 zp->z_mode = new_mode;
                 ASSERT3U((uintptr_t)aclp, !=, NULL);
                 err = zfs_aclset_common(zp, aclp, cr, tx);
-                ASSERT3U(err, ==, 0);
+                ASSERT0(err);
                 if (zp->z_acl_cached)
                         zfs_acl_free(zp->z_acl_cached);
                 zp->z_acl_cached = aclp;
                 aclp = NULL;
         }

@@ -3617,11 +3621,11 @@
                 if (error == 0) {
                         szp->z_pflags |= ZFS_AV_MODIFIED;
 
                         error = sa_update(szp->z_sa_hdl, SA_ZPL_FLAGS(zfsvfs),
                             (void *)&szp->z_pflags, sizeof (uint64_t), tx);
-                        ASSERT3U(error, ==, 0);
+                        ASSERT0(error);
 
                         error = zfs_link_destroy(sdl, szp, tx, ZRENAMING, NULL);
                         if (error == 0) {
                                 zfs_log_rename(zilog, tx, TX_RENAME |
                                     (flags & FIGNORECASE ? TX_CI : 0), sdzp,