summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormm <mm@FreeBSD.org>2012-07-23 20:20:23 +0000
committermm <mm@FreeBSD.org>2012-07-23 20:20:23 +0000
commit3603e35782173157e397a179123588f5fb2dc69c (patch)
tree78309d2a6bccc69d7eadf91849661dacb0e21253
parentc48fd4782125e586b1c99412efa0a4922859cf58 (diff)
downloadFreeBSD-src-3603e35782173157e397a179123588f5fb2dc69c.zip
FreeBSD-src-3603e35782173157e397a179123588f5fb2dc69c.tar.gz
Update vendor-sys/illumos to illumos-gate 13753:2aba784c276b
Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate
-rw-r--r--uts/common/fs/zfs/spa.c21
-rw-r--r--uts/common/fs/zfs/sys/zfeature.h2
-rw-r--r--uts/common/fs/zfs/zfeature.c9
-rw-r--r--uts/common/sys/fs/zfs.h1
4 files changed, 22 insertions, 11 deletions
diff --git a/uts/common/fs/zfs/spa.c b/uts/common/fs/zfs/spa.c
index 828d5e2..9c4af11 100644
--- a/uts/common/fs/zfs/spa.c
+++ b/uts/common/fs/zfs/spa.c
@@ -2149,7 +2149,7 @@ spa_load_impl(spa_t *spa, uint64_t pool_guid, nvlist_t *config,
if (spa_version(spa) >= SPA_VERSION_FEATURES) {
boolean_t missing_feat_read = B_FALSE;
- nvlist_t *unsup_feat;
+ nvlist_t *unsup_feat, *enabled_feat;
if (spa_dir_prop(spa, DMU_POOL_FEATURES_FOR_READ,
&spa->spa_feat_for_read_obj) != 0) {
@@ -2166,27 +2166,32 @@ spa_load_impl(spa_t *spa, uint64_t pool_guid, nvlist_t *config,
return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA, EIO));
}
- VERIFY(nvlist_alloc(&unsup_feat, NV_UNIQUE_NAME, KM_SLEEP) ==
- 0);
+ enabled_feat = fnvlist_alloc();
+ unsup_feat = fnvlist_alloc();
if (!feature_is_supported(spa->spa_meta_objset,
spa->spa_feat_for_read_obj, spa->spa_feat_desc_obj,
- unsup_feat))
+ unsup_feat, enabled_feat))
missing_feat_read = B_TRUE;
if (spa_writeable(spa) || state == SPA_LOAD_TRYIMPORT) {
if (!feature_is_supported(spa->spa_meta_objset,
spa->spa_feat_for_write_obj, spa->spa_feat_desc_obj,
- unsup_feat))
+ unsup_feat, enabled_feat)) {
missing_feat_write = B_TRUE;
+ }
}
+ fnvlist_add_nvlist(spa->spa_load_info,
+ ZPOOL_CONFIG_ENABLED_FEAT, enabled_feat);
+
if (!nvlist_empty(unsup_feat)) {
- VERIFY(nvlist_add_nvlist(spa->spa_load_info,
- ZPOOL_CONFIG_UNSUP_FEAT, unsup_feat) == 0);
+ fnvlist_add_nvlist(spa->spa_load_info,
+ ZPOOL_CONFIG_UNSUP_FEAT, unsup_feat);
}
- nvlist_free(unsup_feat);
+ fnvlist_free(enabled_feat);
+ fnvlist_free(unsup_feat);
if (!missing_feat_read) {
fnvlist_add_boolean(spa->spa_load_info,
diff --git a/uts/common/fs/zfs/sys/zfeature.h b/uts/common/fs/zfs/sys/zfeature.h
index 9ff1c93..481e85b 100644
--- a/uts/common/fs/zfs/sys/zfeature.h
+++ b/uts/common/fs/zfs/sys/zfeature.h
@@ -35,7 +35,7 @@ extern "C" {
#endif
extern boolean_t feature_is_supported(objset_t *os, uint64_t obj,
- uint64_t desc_obj, nvlist_t *unsup_feat);
+ uint64_t desc_obj, nvlist_t *unsup_feat, nvlist_t *enabled_feat);
struct spa;
extern void spa_feature_create_zap_objects(struct spa *, dmu_tx_t *);
diff --git a/uts/common/fs/zfs/zfeature.c b/uts/common/fs/zfs/zfeature.c
index ba72208..b9250df 100644
--- a/uts/common/fs/zfs/zfeature.c
+++ b/uts/common/fs/zfs/zfeature.c
@@ -173,7 +173,7 @@ typedef enum {
*/
boolean_t
feature_is_supported(objset_t *os, uint64_t obj, uint64_t desc_obj,
- nvlist_t *unsup_feat)
+ nvlist_t *unsup_feat, nvlist_t *enabled_feat)
{
boolean_t supported;
zap_cursor_t zc;
@@ -186,11 +186,16 @@ feature_is_supported(objset_t *os, uint64_t obj, uint64_t desc_obj,
ASSERT(za.za_integer_length == sizeof (uint64_t) &&
za.za_num_integers == 1);
+ if (NULL != enabled_feat) {
+ fnvlist_add_uint64(enabled_feat, za.za_name,
+ za.za_first_integer);
+ }
+
if (za.za_first_integer != 0 &&
!zfeature_is_supported(za.za_name)) {
supported = B_FALSE;
- if (unsup_feat != NULL) {
+ if (NULL != unsup_feat) {
char *desc = "";
char buf[MAXPATHLEN];
diff --git a/uts/common/sys/fs/zfs.h b/uts/common/sys/fs/zfs.h
index 511fa95..8639a2b 100644
--- a/uts/common/sys/fs/zfs.h
+++ b/uts/common/sys/fs/zfs.h
@@ -528,6 +528,7 @@ typedef struct zpool_rewind_policy {
#define ZPOOL_CONFIG_LOAD_INFO "load_info" /* not stored on disk */
#define ZPOOL_CONFIG_REWIND_INFO "rewind_info" /* not stored on disk */
#define ZPOOL_CONFIG_UNSUP_FEAT "unsup_feat" /* not stored on disk */
+#define ZPOOL_CONFIG_ENABLED_FEAT "enabled_feat" /* not stored on disk */
#define ZPOOL_CONFIG_CAN_RDONLY "can_rdonly" /* not stored on disk */
#define ZPOOL_CONFIG_FEATURES_FOR_READ "features_for_read"
#define ZPOOL_CONFIG_FEATURE_STATS "feature_stats" /* not stored on disk */
OpenPOWER on IntegriCloud