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/dsl_dataset.c
          +++ new/usr/src/uts/common/fs/zfs/dsl_dataset.c
↓ open down ↓ 344 lines elided ↑ open up ↑
 345  345          dmu_object_info_t doi;
 346  346  
 347  347          ASSERT(dsl_pool_config_held(dp));
 348  348  
 349  349          err = dmu_bonus_hold(mos, dsobj, tag, &dbuf);
 350  350          if (err != 0)
 351  351                  return (err);
 352  352  
 353  353          /* Make sure dsobj has the correct object type. */
 354  354          dmu_object_info_from_db(dbuf, &doi);
 355      -        if (doi.doi_type != DMU_OT_DSL_DATASET) {
      355 +        if (doi.doi_bonus_type != DMU_OT_DSL_DATASET) {
 356  356                  dmu_buf_rele(dbuf, tag);
 357  357                  return (SET_ERROR(EINVAL));
 358  358          }
 359  359  
 360  360          ds = dmu_buf_get_user(dbuf);
 361  361          if (ds == NULL) {
 362  362                  dsl_dataset_t *winner = NULL;
 363  363  
 364  364                  ds = kmem_zalloc(sizeof (dsl_dataset_t), KM_SLEEP);
 365  365                  ds->ds_dbuf = dbuf;
↓ open down ↓ 2598 lines elided ↑ open up ↑
2964 2964          if (later->ds_dir->dd_phys->dd_origin_obj == earlier->ds_object)
2965 2965                  return (B_TRUE);
2966 2966          dsl_dataset_t *origin;
2967 2967          error = dsl_dataset_hold_obj(dp,
2968 2968              later->ds_dir->dd_phys->dd_origin_obj, FTAG, &origin);
2969 2969          if (error != 0)
2970 2970                  return (B_FALSE);
2971 2971          ret = dsl_dataset_is_before(origin, earlier);
2972 2972          dsl_dataset_rele(origin, FTAG);
2973 2973          return (ret);
     2974 +}
     2975 +
     2976 +
     2977 +void
     2978 +dsl_dataset_zapify(dsl_dataset_t *ds, dmu_tx_t *tx)
     2979 +{
     2980 +        objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset;
     2981 +        dmu_object_zapify(mos, ds->ds_object, DMU_OT_DSL_DATASET, tx);
2974 2982  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX