Print this page
4171 clean up spa_feature_*() interfaces
4172 implement extensible_dataset feature for use by other zpool features
Reviewed by: Max Grossman <max.grossman@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>

@@ -561,20 +561,24 @@
 }
 
 static int
 verify_spacemap_refcounts(spa_t *spa)
 {
-        int expected_refcount, actual_refcount;
+        uint64_t expected_refcount = 0;
+        uint64_t actual_refcount;
 
-        expected_refcount = spa_feature_get_refcount(spa,
-            &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]);
+        (void) feature_get_refcount(spa,
+            &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM],
+            &expected_refcount);
         actual_refcount = get_dtl_refcount(spa->spa_root_vdev);
         actual_refcount += get_metaslab_refcount(spa->spa_root_vdev);
 
         if (expected_refcount != actual_refcount) {
-                (void) printf("space map refcount mismatch: expected %d != "
-                    "actual %d\n", expected_refcount, actual_refcount);
+                (void) printf("space map refcount mismatch: expected %lld != "
+                    "actual %lld\n",
+                    (longlong_t)expected_refcount,
+                    (longlong_t)actual_refcount);
                 return (2);
         }
         return (0);
 }
 

@@ -672,12 +676,11 @@
                 metaslab_unload(msp);
                 mutex_exit(&msp->ms_lock);
         }
 
         if (dump_opt['m'] > 1 && sm != NULL &&
-            spa_feature_is_active(spa,
-            &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM])) {
+            spa_feature_is_active(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) {
                 /*
                  * The space map histogram represents free space in chunks
                  * of sm_shift (i.e. bucket 0 refers to 2^sm_shift).
                  */
                 (void) printf("\tOn-disk histogram:\n");

@@ -2464,12 +2467,11 @@
             count_block_cb, &zcb, NULL);
         if (spa_version(spa) >= SPA_VERSION_DEADLISTS) {
                 (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj,
                     count_block_cb, &zcb, NULL);
         }
-        if (spa_feature_is_active(spa,
-            &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) {
+        if (spa_feature_is_active(spa, SPA_FEATURE_ASYNC_DESTROY)) {
                 VERIFY3U(0, ==, bptree_iterate(spa->spa_meta_objset,
                     spa->spa_dsl_pool->dp_bptree_obj, B_FALSE, count_block_cb,
                     &zcb, NULL));
         }
 

@@ -2791,11 +2793,11 @@
                                 dump_bpobj(&spa->spa_dsl_pool->dp_free_bpobj,
                                     "Pool snapshot frees", 0);
                         }
 
                         if (spa_feature_is_active(spa,
-                            &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) {
+                            SPA_FEATURE_ASYNC_DESTROY)) {
                                 dump_bptree(spa->spa_meta_objset,
                                     spa->spa_dsl_pool->dp_bptree_obj,
                                     "Pool dataset frees");
                         }
                         dump_dtl(spa->spa_root_vdev, 0);