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

@@ -168,11 +168,11 @@
 
                 err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT,
                     DMU_POOL_FREE_BPOBJ, sizeof (uint64_t), 1, &obj);
                 if (err)
                         goto out;
-                VERIFY3U(0, ==, bpobj_open(&dp->dp_free_bpobj,
+                VERIFY0(bpobj_open(&dp->dp_free_bpobj,
                     dp->dp_meta_objset, obj));
         }
 
         if (spa_feature_is_active(dp->dp_spa,
             &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) {

@@ -254,14 +254,14 @@
             NULL, &dp->dp_meta_rootbp, DMU_OST_META, tx);
 
         /* create the pool directory */
         err = zap_create_claim(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT,
             DMU_OT_OBJECT_DIRECTORY, DMU_OT_NONE, 0, tx);
-        ASSERT3U(err, ==, 0);
+        ASSERT0(err);
 
         /* Initialize scan structures */
-        VERIFY3U(0, ==, dsl_scan_init(dp, txg));
+        VERIFY0(dsl_scan_init(dp, txg));
 
         /* create and open the root dir */
         dp->dp_root_dir_obj = dsl_dir_create_sync(dp, NULL, NULL, tx);
         VERIFY(0 == dsl_dir_open_obj(dp, dp->dp_root_dir_obj,
             NULL, dp, &dp->dp_root_dir));

@@ -280,11 +280,11 @@
 
                 /* create and open the free_bplist */
                 obj = bpobj_alloc(dp->dp_meta_objset, SPA_MAXBLOCKSIZE, tx);
                 VERIFY(zap_add(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT,
                     DMU_POOL_FREE_BPOBJ, sizeof (uint64_t), 1, &obj, tx) == 0);
-                VERIFY3U(0, ==, bpobj_open(&dp->dp_free_bpobj,
+                VERIFY0(bpobj_open(&dp->dp_free_bpobj,
                     dp->dp_meta_objset, obj));
         }
 
         if (spa_version(spa) >= SPA_VERSION_DSL_SCRUB)
                 dsl_pool_create_origin(dp, tx);

@@ -672,11 +672,11 @@
 dsl_pool_upgrade_clones(dsl_pool_t *dp, dmu_tx_t *tx)
 {
         ASSERT(dmu_tx_is_syncing(tx));
         ASSERT(dp->dp_origin_snap != NULL);
 
-        VERIFY3U(0, ==, dmu_objset_find_spa(dp->dp_spa, NULL, upgrade_clones_cb,
+        VERIFY0(dmu_objset_find_spa(dp->dp_spa, NULL, upgrade_clones_cb,
             tx, DS_FIND_CHILDREN));
 }
 
 /* ARGSUSED */
 static int

@@ -685,25 +685,25 @@
         dmu_tx_t *tx = arg;
         dsl_dataset_t *ds;
         dsl_pool_t *dp = spa_get_dsl(spa);
         objset_t *mos = dp->dp_meta_objset;
 
-        VERIFY3U(0, ==, dsl_dataset_hold_obj(dp, dsobj, FTAG, &ds));
+        VERIFY0(dsl_dataset_hold_obj(dp, dsobj, FTAG, &ds));
 
         if (ds->ds_dir->dd_phys->dd_origin_obj) {
                 dsl_dataset_t *origin;
 
-                VERIFY3U(0, ==, dsl_dataset_hold_obj(dp,
+                VERIFY0(dsl_dataset_hold_obj(dp,
                     ds->ds_dir->dd_phys->dd_origin_obj, FTAG, &origin));
 
                 if (origin->ds_dir->dd_phys->dd_clones == 0) {
                         dmu_buf_will_dirty(origin->ds_dir->dd_dbuf, tx);
                         origin->ds_dir->dd_phys->dd_clones = zap_create(mos,
                             DMU_OT_DSL_CLONES, DMU_OT_NONE, 0, tx);
                 }
 
-                VERIFY3U(0, ==, zap_add_int(dp->dp_meta_objset,
+                VERIFY0(zap_add_int(dp->dp_meta_objset,
                     origin->ds_dir->dd_phys->dd_clones, dsobj, tx));
 
                 dsl_dataset_rele(origin, FTAG);
         }
 

@@ -726,16 +726,16 @@
          * returns the old version, and we need a new-version bpobj with
          * subobj support.  So call dmu_object_alloc() directly.
          */
         obj = dmu_object_alloc(dp->dp_meta_objset, DMU_OT_BPOBJ,
             SPA_MAXBLOCKSIZE, DMU_OT_BPOBJ_HDR, sizeof (bpobj_phys_t), tx);
-        VERIFY3U(0, ==, zap_add(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT,
+        VERIFY0(zap_add(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT,
             DMU_POOL_FREE_BPOBJ, sizeof (uint64_t), 1, &obj, tx));
-        VERIFY3U(0, ==, bpobj_open(&dp->dp_free_bpobj,
+        VERIFY0(bpobj_open(&dp->dp_free_bpobj,
             dp->dp_meta_objset, obj));
 
-        VERIFY3U(0, ==, dmu_objset_find_spa(dp->dp_spa, NULL,
+        VERIFY0(dmu_objset_find_spa(dp->dp_spa, NULL,
             upgrade_dir_clones_cb, tx, DS_FIND_CHILDREN));
 }
 
 void
 dsl_pool_create_origin(dsl_pool_t *dp, dmu_tx_t *tx)