summaryrefslogtreecommitdiffstats
path: root/module/zfs/space_map.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/space_map.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/space_map.c')
-rw-r--r--module/zfs/space_map.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/module/zfs/space_map.c b/module/zfs/space_map.c
index bbc926d4d..645a81387 100644
--- a/module/zfs/space_map.c
+++ b/module/zfs/space_map.c
@@ -482,8 +482,6 @@ space_map_truncate(space_map_t *sm, dmu_tx_t *tx)
{
objset_t *os = sm->sm_os;
spa_t *spa = dmu_objset_spa(os);
- zfeature_info_t *space_map_histogram =
- &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM];
dmu_object_info_t doi;
int bonuslen;
@@ -493,7 +491,7 @@ space_map_truncate(space_map_t *sm, dmu_tx_t *tx)
VERIFY0(dmu_free_range(os, space_map_object(sm), 0, -1ULL, tx));
dmu_object_info_from_db(sm->sm_dbuf, &doi);
- if (spa_feature_is_enabled(spa, space_map_histogram)) {
+ if (spa_feature_is_enabled(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) {
bonuslen = sizeof (space_map_phys_t);
ASSERT3U(bonuslen, <=, dmu_bonus_max());
} else {
@@ -533,13 +531,11 @@ uint64_t
space_map_alloc(objset_t *os, dmu_tx_t *tx)
{
spa_t *spa = dmu_objset_spa(os);
- zfeature_info_t *space_map_histogram =
- &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM];
uint64_t object;
int bonuslen;
- if (spa_feature_is_enabled(spa, space_map_histogram)) {
- spa_feature_incr(spa, space_map_histogram, tx);
+ if (spa_feature_is_enabled(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) {
+ spa_feature_incr(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM, tx);
bonuslen = sizeof (space_map_phys_t);
ASSERT3U(bonuslen, <=, dmu_bonus_max());
} else {
@@ -557,20 +553,20 @@ void
space_map_free(space_map_t *sm, dmu_tx_t *tx)
{
spa_t *spa;
- zfeature_info_t *space_map_histogram =
- &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM];
if (sm == NULL)
return;
spa = dmu_objset_spa(sm->sm_os);
- if (spa_feature_is_enabled(spa, space_map_histogram)) {
+ if (spa_feature_is_enabled(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) {
dmu_object_info_t doi;
dmu_object_info_from_db(sm->sm_dbuf, &doi);
if (doi.doi_bonus_size != SPACE_MAP_SIZE_V0) {
- VERIFY(spa_feature_is_active(spa, space_map_histogram));
- spa_feature_decr(spa, space_map_histogram, tx);
+ VERIFY(spa_feature_is_active(spa,
+ SPA_FEATURE_SPACEMAP_HISTOGRAM));
+ spa_feature_decr(spa,
+ SPA_FEATURE_SPACEMAP_HISTOGRAM, tx);
}
}