summaryrefslogtreecommitdiffstats
path: root/module/zfs/dsl_destroy.c
diff options
context:
space:
mode:
authorMatthew Ahrens <[email protected]>2013-10-08 09:13:05 -0800
committerBrian Behlendorf <[email protected]>2014-07-25 16:40:07 -0700
commitfa86b5dbb6d33371df344efb2adb0aba026d097c (patch)
tree1a512e0af9bff65a349468b30881e4cfa26641d5 /module/zfs/dsl_destroy.c
parent62b693930876ba8d929632e1ba0ae5dc48a85001 (diff)
Illumos 4171, 4172
4171 clean up spa_feature_*() interfaces 4172 implement extensible_dataset feature for use by other zpool features Reviewed by: Max Grossman <[email protected]> Reviewed by: Christopher Siden <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Jerry Jelinek <[email protected]> Approved by: Garrett D'Amore <[email protected]>a References: https://www.illumos.org/issues/4171 https://www.illumos.org/issues/4172 https://github.com/illumos/illumos-gate/commit/2acef22 Ported-by: Tim Chase <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #2528
Diffstat (limited to 'module/zfs/dsl_destroy.c')
-rw-r--r--module/zfs/dsl_destroy.c23
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;