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_misc.c
          +++ new/usr/src/uts/common/fs/zfs/spa_misc.c
↓ open down ↓ 1135 lines elided ↑ open up ↑
1136 1136  
1137 1137  /*
1138 1138   * ==========================================================================
1139 1139   * Miscellaneous functions
1140 1140   * ==========================================================================
1141 1141   */
1142 1142  
1143 1143  void
1144 1144  spa_activate_mos_feature(spa_t *spa, const char *feature)
1145 1145  {
1146      -        (void) nvlist_add_boolean(spa->spa_label_features, feature);
1147      -        vdev_config_dirty(spa->spa_root_vdev);
     1146 +        if (!nvlist_exists(spa->spa_label_features, feature)) {
     1147 +                fnvlist_add_boolean(spa->spa_label_features, feature);
     1148 +                vdev_config_dirty(spa->spa_root_vdev);
     1149 +        }
1148 1150  }
1149 1151  
1150 1152  void
1151 1153  spa_deactivate_mos_feature(spa_t *spa, const char *feature)
1152 1154  {
1153      -        (void) nvlist_remove_all(spa->spa_label_features, feature);
1154      -        vdev_config_dirty(spa->spa_root_vdev);
     1155 +        if (nvlist_remove_all(spa->spa_label_features, feature) == 0)
     1156 +                vdev_config_dirty(spa->spa_root_vdev);
1155 1157  }
1156 1158  
1157 1159  /*
1158 1160   * Rename a spa_t.
1159 1161   */
1160 1162  int
1161 1163  spa_rename(const char *name, const char *newname)
1162 1164  {
1163 1165          spa_t *spa;
1164 1166          int err;
↓ open down ↓ 697 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX