diff options
Diffstat (limited to 'module/zfs/dsl_destroy.c')
-rw-r--r-- | module/zfs/dsl_destroy.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/module/zfs/dsl_destroy.c b/module/zfs/dsl_destroy.c index 351165dbf..11038b1f9 100644 --- a/module/zfs/dsl_destroy.c +++ b/module/zfs/dsl_destroy.c @@ -38,6 +38,7 @@ #include <sys/zfeature.h> #include <sys/zfs_ioctl.h> #include <sys/dsl_deleg.h> +#include <sys/dmu_impl.h> typedef struct dmu_snapshots_destroy_arg { nvlist_t *dsda_snaps; @@ -452,7 +453,7 @@ dsl_destroy_snapshot_sync_impl(dsl_dataset_t *ds, boolean_t defer, dmu_tx_t *tx) VERIFY0(zap_destroy(mos, ds->ds_phys->ds_userrefs_obj, tx)); dsl_dir_rele(ds->ds_dir, ds); ds->ds_dir = NULL; - VERIFY0(dmu_object_free(mos, obj, tx)); + dmu_object_free_zapified(mos, obj, tx); } static void @@ -679,7 +680,7 @@ dsl_dir_destroy_sync(uint64_t ddobj, dmu_tx_t *tx) dd->dd_parent->dd_phys->dd_child_dir_zapobj, dd->dd_myname, tx)); dsl_dir_rele(dd, FTAG); - VERIFY0(dmu_object_free(mos, ddobj, tx)); + dmu_object_free_zapified(mos, ddobj, tx); } void @@ -689,7 +690,6 @@ dsl_destroy_head_sync_impl(dsl_dataset_t *ds, dmu_tx_t *tx) objset_t *mos = dp->dp_meta_objset; uint64_t obj, ddobj, prevobj = 0; boolean_t rmorigin; - zfeature_info_t *async_destroy; objset_t *os; ASSERT3U(ds->ds_phys->ds_num_children, <=, 1); @@ -734,9 +734,6 @@ dsl_destroy_head_sync_impl(dsl_dataset_t *ds, dmu_tx_t *tx) ds->ds_prev->ds_phys->ds_num_children--; } - async_destroy = - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY]; - /* * Destroy the deadlist. Unless it's a clone, the * deadlist should be empty. (If it's a clone, it's @@ -749,7 +746,7 @@ dsl_destroy_head_sync_impl(dsl_dataset_t *ds, dmu_tx_t *tx) VERIFY0(dmu_objset_from_ds(ds, &os)); - if (!spa_feature_is_enabled(dp->dp_spa, async_destroy)) { + if (!spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_ASYNC_DESTROY)) { old_synchronous_dataset_destroy(ds, tx); } else { /* @@ -760,10 +757,11 @@ dsl_destroy_head_sync_impl(dsl_dataset_t *ds, dmu_tx_t *tx) zil_destroy_sync(dmu_objset_zil(os), tx); - if (!spa_feature_is_active(dp->dp_spa, async_destroy)) { + if (!spa_feature_is_active(dp->dp_spa, + SPA_FEATURE_ASYNC_DESTROY)) { dsl_scan_t *scn = dp->dp_scan; - - spa_feature_incr(dp->dp_spa, async_destroy, tx); + spa_feature_incr(dp->dp_spa, SPA_FEATURE_ASYNC_DESTROY, + tx); dp->dp_bptree_obj = bptree_alloc(mos, tx); VERIFY0(zap_add(mos, DMU_POOL_DIRECTORY_OBJECT, @@ -823,7 +821,7 @@ dsl_destroy_head_sync_impl(dsl_dataset_t *ds, dmu_tx_t *tx) ASSERT0(ds->ds_phys->ds_userrefs_obj); dsl_dir_rele(ds->ds_dir, ds); ds->ds_dir = NULL; - VERIFY0(dmu_object_free(mos, obj, tx)); + dmu_object_free_zapified(mos, obj, tx); dsl_dir_destroy_sync(ddobj, tx); @@ -879,8 +877,7 @@ dsl_destroy_head(const char *name) error = spa_open(name, &spa, FTAG); if (error != 0) return (error); - isenabled = spa_feature_is_enabled(spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY]); + isenabled = spa_feature_is_enabled(spa, SPA_FEATURE_ASYNC_DESTROY); spa_close(spa, FTAG); ddha.ddha_name = name; |