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

@@ -590,13 +590,13 @@
         if (vd->vdev_mg != NULL) {
                 vdev_metaslab_fini(vd);
                 metaslab_group_destroy(vd->vdev_mg);
         }
 
-        ASSERT3U(vd->vdev_stat.vs_space, ==, 0);
-        ASSERT3U(vd->vdev_stat.vs_dspace, ==, 0);
-        ASSERT3U(vd->vdev_stat.vs_alloc, ==, 0);
+        ASSERT0(vd->vdev_stat.vs_space);
+        ASSERT0(vd->vdev_stat.vs_dspace);
+        ASSERT0(vd->vdev_stat.vs_alloc);
 
         /*
          * Remove this vdev from its parent's child list.
          */
         vdev_remove_child(vd->vdev_parent, vd);

@@ -1803,11 +1803,11 @@
         tx = dmu_tx_create_assigned(spa->spa_dsl_pool, txg);
 
         if (vd->vdev_detached) {
                 if (smo->smo_object != 0) {
                         int err = dmu_object_free(mos, smo->smo_object, tx);
-                        ASSERT3U(err, ==, 0);
+                        ASSERT0(err);
                         smo->smo_object = 0;
                 }
                 dmu_tx_commit(tx);
                 return;
         }

@@ -2003,11 +2003,11 @@
         dmu_tx_t *tx;
 
         tx = dmu_tx_create_assigned(spa_get_dsl(spa), txg);
 
         if (vd->vdev_dtl_smo.smo_object) {
-                ASSERT3U(vd->vdev_dtl_smo.smo_alloc, ==, 0);
+                ASSERT0(vd->vdev_dtl_smo.smo_alloc);
                 (void) dmu_object_free(mos, vd->vdev_dtl_smo.smo_object, tx);
                 vd->vdev_dtl_smo.smo_object = 0;
         }
 
         if (vd->vdev_ms != NULL) {

@@ -2015,11 +2015,11 @@
                         metaslab_t *msp = vd->vdev_ms[m];
 
                         if (msp == NULL || msp->ms_smo.smo_object == 0)
                                 continue;
 
-                        ASSERT3U(msp->ms_smo.smo_alloc, ==, 0);
+                        ASSERT0(msp->ms_smo.smo_alloc);
                         (void) dmu_object_free(mos, msp->ms_smo.smo_object, tx);
                         msp->ms_smo.smo_object = 0;
                 }
         }
 

@@ -2293,11 +2293,11 @@
                                         return (spa_vdev_state_exit(spa,
                                             vd, error));
                                 (void) spa_vdev_state_exit(spa, vd, 0);
                                 goto top;
                         }
-                        ASSERT3U(tvd->vdev_stat.vs_alloc, ==, 0);
+                        ASSERT0(tvd->vdev_stat.vs_alloc);
                 }
 
                 /*
                  * Offline this device and reopen its top-level vdev.
                  * If the top-level vdev is a log device then just offline