diff options
author | Paul Dagnelie <[email protected]> | 2018-10-16 11:15:04 -0700 |
---|---|---|
committer | Matthew Ahrens <[email protected]> | 2018-10-16 11:15:04 -0700 |
commit | d52d80b700229e879fe757c989c3bcd3a3a42f2a (patch) | |
tree | baa4fde58282a0a23eb038f163e1a6505fe60665 /include/sys/dsl_dataset.h | |
parent | 779a6c0bf6df76e0dd92c1ccf81f48512b835bb0 (diff) |
Add types to featureflags in zfs
The boolean featureflags in use thus far in ZFS are extremely useful,
but because they take advantage of the zap layer, more interesting data
than just a true/false value can be stored in a featureflag. In redacted
send/receive, this is used to store the list of redaction snapshots for
a redacted dataset.
This change adds the ability for ZFS to store types other than a boolean
in a featureflag. The only other implemented type is a uint64_t array.
It also modifies the interfaces around dataset features to accomodate
the new capabilities, and adds a few new functions to increase
encapsulation.
This functionality will be used by the Redacted Send/Receive feature.
Reviewed-by: Matthew Ahrens <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Paul Dagnelie <[email protected]>
Closes #7981
Diffstat (limited to 'include/sys/dsl_dataset.h')
-rw-r--r-- | include/sys/dsl_dataset.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/include/sys/dsl_dataset.h b/include/sys/dsl_dataset.h index 7eded35a1..47a46f07d 100644 --- a/include/sys/dsl_dataset.h +++ b/include/sys/dsl_dataset.h @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2017 by Delphix. All rights reserved. + * Copyright (c) 2011, 2018 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. */ @@ -242,13 +242,13 @@ typedef struct dsl_dataset { * For ZFEATURE_FLAG_PER_DATASET features, set if this dataset * uses this feature. */ - uint8_t ds_feature_inuse[SPA_FEATURES]; + void *ds_feature[SPA_FEATURES]; /* * Set if we need to activate the feature on this dataset this txg * (used only in syncing context). */ - uint8_t ds_feature_activation_needed[SPA_FEATURES]; + void *ds_feature_activation[SPA_FEATURES]; /* Protected by ds_lock; keep at end of struct for better locality */ char ds_snapname[ZFS_MAX_DATASET_NAME_LEN]; @@ -449,10 +449,13 @@ void dsl_dataset_create_remap_deadlist(dsl_dataset_t *ds, dmu_tx_t *tx); boolean_t dsl_dataset_remap_deadlist_exists(dsl_dataset_t *ds); void dsl_dataset_destroy_remap_deadlist(dsl_dataset_t *ds, dmu_tx_t *tx); -void dsl_dataset_activate_feature(uint64_t dsobj, - spa_feature_t f, dmu_tx_t *tx); -void dsl_dataset_deactivate_feature(uint64_t dsobj, - spa_feature_t f, dmu_tx_t *tx); +void dsl_dataset_activate_feature(uint64_t dsobj, spa_feature_t f, void *arg, + dmu_tx_t *tx); +void dsl_dataset_deactivate_feature(dsl_dataset_t *ds, spa_feature_t f, + dmu_tx_t *tx); +boolean_t dsl_dataset_feature_is_active(dsl_dataset_t *ds, spa_feature_t f); +boolean_t dsl_dataset_get_uint64_array_feature(dsl_dataset_t *ds, + spa_feature_t f, uint64_t *outlength, uint64_t **outp); #ifdef ZFS_DEBUG #define dprintf_ds(ds, fmt, ...) do { \ |