Print this page
4101 metaslab_debug should allow for fine-grained control
4102 space_maps should store more information about themselves
4103 space map object blocksize should be increased
4104 ::spa_space no longer works
4105 removing a mirrored log device results in a leaked object
4106 asynchronously load metaslab
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Sebastien Roy <seb@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/zfeature.c
          +++ new/usr/src/uts/common/fs/zfs/zfeature.c
↓ open down ↓ 353 lines elided ↑ open up ↑
 354  354   */
 355  355  void
 356  356  spa_feature_enable(spa_t *spa, zfeature_info_t *feature, dmu_tx_t *tx)
 357  357  {
 358  358          ASSERT3U(spa_version(spa), >=, SPA_VERSION_FEATURES);
 359  359          VERIFY3U(0, ==, feature_do_action(spa->spa_meta_objset,
 360  360              spa->spa_feat_for_read_obj, spa->spa_feat_for_write_obj,
 361  361              spa->spa_feat_desc_obj, feature, FEATURE_ACTION_ENABLE, tx));
 362  362  }
 363  363  
 364      -/*
 365      - * If the specified feature has not yet been enabled, this function returns
 366      - * ENOTSUP; otherwise, this function increments the feature's refcount (or
 367      - * returns EOVERFLOW if the refcount cannot be incremented). This function must
 368      - * be called from syncing context.
 369      - */
 370  364  void
 371  365  spa_feature_incr(spa_t *spa, zfeature_info_t *feature, dmu_tx_t *tx)
 372  366  {
      367 +        ASSERT(dmu_tx_is_syncing(tx));
 373  368          ASSERT3U(spa_version(spa), >=, SPA_VERSION_FEATURES);
 374  369          VERIFY3U(0, ==, feature_do_action(spa->spa_meta_objset,
 375  370              spa->spa_feat_for_read_obj, spa->spa_feat_for_write_obj,
 376  371              spa->spa_feat_desc_obj, feature, FEATURE_ACTION_INCR, tx));
 377  372  }
 378  373  
 379      -/*
 380      - * If the specified feature has not yet been enabled, this function returns
 381      - * ENOTSUP; otherwise, this function decrements the feature's refcount (or
 382      - * returns EOVERFLOW if the refcount is already 0). This function must
 383      - * be called from syncing context.
 384      - */
 385  374  void
 386  375  spa_feature_decr(spa_t *spa, zfeature_info_t *feature, dmu_tx_t *tx)
 387  376  {
      377 +        ASSERT(dmu_tx_is_syncing(tx));
 388  378          ASSERT3U(spa_version(spa), >=, SPA_VERSION_FEATURES);
 389  379          VERIFY3U(0, ==, feature_do_action(spa->spa_meta_objset,
 390  380              spa->spa_feat_for_read_obj, spa->spa_feat_for_write_obj,
 391  381              spa->spa_feat_desc_obj, feature, FEATURE_ACTION_DECR, tx));
 392  382  }
 393  383  
      384 +/*
      385 + * This interface is for debugging only. Normal consumers should use
      386 + * spa_feature_is_enabled/spa_feature_is_active.
      387 + */
      388 +int
      389 +spa_feature_get_refcount(spa_t *spa, zfeature_info_t *feature)
      390 +{
      391 +        int err;
      392 +        uint64_t refcount;
      393 +
      394 +        if (spa_version(spa) < SPA_VERSION_FEATURES)
      395 +                return (B_FALSE);
      396 +
      397 +        err = feature_get_refcount(spa->spa_meta_objset,
      398 +            spa->spa_feat_for_read_obj, spa->spa_feat_for_write_obj,
      399 +            feature, &refcount);
      400 +        ASSERT(err == 0 || err == ENOTSUP);
      401 +        return (err == 0 ? refcount : 0);
      402 +}
      403 +
 394  404  boolean_t
 395  405  spa_feature_is_enabled(spa_t *spa, zfeature_info_t *feature)
 396  406  {
 397  407          int err;
 398  408          uint64_t refcount;
 399  409  
 400  410          if (spa_version(spa) < SPA_VERSION_FEATURES)
 401  411                  return (B_FALSE);
 402  412  
 403  413          err = feature_get_refcount(spa->spa_meta_objset,
↓ open down ↓ 21 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX