Print this page
4171 clean up spa_feature_*() interfaces
4172 implement extensible_dataset feature for use by other zpool features
Reviewed by: Max Grossman <max.grossman@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/spa.c
          +++ new/usr/src/uts/common/fs/zfs/spa.c
↓ open down ↓ 2292 lines elided ↑ open up ↑
2293 2293                  }
2294 2294  
2295 2295                  if (spa_dir_prop(spa, DMU_POOL_FEATURE_DESCRIPTIONS,
2296 2296                      &spa->spa_feat_desc_obj) != 0) {
2297 2297                          return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA, EIO));
2298 2298                  }
2299 2299  
2300 2300                  enabled_feat = fnvlist_alloc();
2301 2301                  unsup_feat = fnvlist_alloc();
2302 2302  
2303      -                if (!feature_is_supported(spa->spa_meta_objset,
2304      -                    spa->spa_feat_for_read_obj, spa->spa_feat_desc_obj,
     2303 +                if (!spa_features_check(spa, B_FALSE,
2305 2304                      unsup_feat, enabled_feat))
2306 2305                          missing_feat_read = B_TRUE;
2307 2306  
2308 2307                  if (spa_writeable(spa) || state == SPA_LOAD_TRYIMPORT) {
2309      -                        if (!feature_is_supported(spa->spa_meta_objset,
2310      -                            spa->spa_feat_for_write_obj, spa->spa_feat_desc_obj,
     2308 +                        if (!spa_features_check(spa, B_TRUE,
2311 2309                              unsup_feat, enabled_feat)) {
2312 2310                                  missing_feat_write = B_TRUE;
2313 2311                          }
2314 2312                  }
2315 2313  
2316 2314                  fnvlist_add_nvlist(spa->spa_load_info,
2317 2315                      ZPOOL_CONFIG_ENABLED_FEAT, enabled_feat);
2318 2316  
2319 2317                  if (!nvlist_empty(unsup_feat)) {
2320 2318                          fnvlist_add_nvlist(spa->spa_load_info,
↓ open down ↓ 3586 lines elided ↑ open up ↑
5907 5905          nvpair_t *elem = NULL;
5908 5906  
5909 5907          mutex_enter(&spa->spa_props_lock);
5910 5908  
5911 5909          while ((elem = nvlist_next_nvpair(nvp, elem))) {
5912 5910                  uint64_t intval;
5913 5911                  char *strval, *fname;
5914 5912                  zpool_prop_t prop;
5915 5913                  const char *propname;
5916 5914                  zprop_type_t proptype;
5917      -                zfeature_info_t *feature;
     5915 +                spa_feature_t fid;
5918 5916  
5919 5917                  switch (prop = zpool_name_to_prop(nvpair_name(elem))) {
5920 5918                  case ZPROP_INVAL:
5921 5919                          /*
5922 5920                           * We checked this earlier in spa_prop_validate().
5923 5921                           */
5924 5922                          ASSERT(zpool_prop_feature(nvpair_name(elem)));
5925 5923  
5926 5924                          fname = strchr(nvpair_name(elem), '@') + 1;
5927      -                        VERIFY0(zfeature_lookup_name(fname, &feature));
     5925 +                        VERIFY0(zfeature_lookup_name(fname, &fid));
5928 5926  
5929      -                        spa_feature_enable(spa, feature, tx);
     5927 +                        spa_feature_enable(spa, fid, tx);
5930 5928                          spa_history_log_internal(spa, "set", tx,
5931 5929                              "%s=enabled", nvpair_name(elem));
5932 5930                          break;
5933 5931  
5934 5932                  case ZPOOL_PROP_VERSION:
5935 5933                          intval = fnvpair_value_uint64(elem);
5936 5934                          /*
5937 5935                           * The version is synced seperatly before other
5938 5936                           * properties and should be correct by now.
5939 5937                           */
↓ open down ↓ 584 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX