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>


  32 #include <sys/spa.h>
  33 #include <sys/txg.h>
  34 #include <sys/zio.h>
  35 #include <sys/bplist.h>
  36 #include <sys/dsl_synctask.h>
  37 #include <sys/zfs_context.h>
  38 #include <sys/dsl_deadlist.h>
  39 #include <sys/refcount.h>
  40 
  41 #ifdef  __cplusplus
  42 extern "C" {
  43 #endif
  44 
  45 struct dsl_dataset;
  46 struct dsl_dir;
  47 struct dsl_pool;
  48 
  49 #define DS_FLAG_INCONSISTENT    (1ULL<<0)
  50 #define DS_IS_INCONSISTENT(ds)  \
  51         ((ds)->ds_phys->ds_flags & DS_FLAG_INCONSISTENT)

  52 /*
  53  * Note: nopromote can not yet be set, but we want support for it in this
  54  * on-disk version, so that we don't need to upgrade for it later.
  55  */
  56 #define DS_FLAG_NOPROMOTE       (1ULL<<1)
  57 
  58 /*
  59  * DS_FLAG_UNIQUE_ACCURATE is set if ds_unique_bytes has been correctly
  60  * calculated for head datasets (starting with SPA_VERSION_UNIQUE_ACCURATE,
  61  * refquota/refreservations).
  62  */
  63 #define DS_FLAG_UNIQUE_ACCURATE (1ULL<<2)
  64 
  65 /*
  66  * DS_FLAG_DEFER_DESTROY is set after 'zfs destroy -d' has been called
  67  * on a dataset. This allows the dataset to be destroyed using 'zfs release'.
  68  */
  69 #define DS_FLAG_DEFER_DESTROY   (1ULL<<3)
  70 #define DS_IS_DEFER_DESTROY(ds) \
  71         ((ds)->ds_phys->ds_flags & DS_FLAG_DEFER_DESTROY)
  72 
  73 /*





  74  * DS_FLAG_CI_DATASET is set if the dataset contains a file system whose
  75  * name lookups should be performed case-insensitively.
  76  */
  77 #define DS_FLAG_CI_DATASET      (1ULL<<16)
  78 
  79 #define DS_CREATE_FLAG_NODIRTY  (1ULL<<24)
  80 
  81 typedef struct dsl_dataset_phys {
  82         uint64_t ds_dir_obj;            /* DMU_OT_DSL_DIR */
  83         uint64_t ds_prev_snap_obj;      /* DMU_OT_DSL_DATASET */
  84         uint64_t ds_prev_snap_txg;
  85         uint64_t ds_next_snap_obj;      /* DMU_OT_DSL_DATASET */
  86         uint64_t ds_snapnames_zapobj;   /* DMU_OT_DSL_DS_SNAP_MAP 0 for snaps */
  87         uint64_t ds_num_children;       /* clone/snap children; ==0 for head */
  88         uint64_t ds_creation_time;      /* seconds since 1970 */
  89         uint64_t ds_creation_txg;
  90         uint64_t ds_deadlist_obj;       /* DMU_OT_DEADLIST */
  91         /*
  92          * ds_referenced_bytes, ds_compressed_bytes, and ds_uncompressed_bytes
  93          * include all blocks referenced by this dataset, including those




  32 #include <sys/spa.h>
  33 #include <sys/txg.h>
  34 #include <sys/zio.h>
  35 #include <sys/bplist.h>
  36 #include <sys/dsl_synctask.h>
  37 #include <sys/zfs_context.h>
  38 #include <sys/dsl_deadlist.h>
  39 #include <sys/refcount.h>
  40 
  41 #ifdef  __cplusplus
  42 extern "C" {
  43 #endif
  44 
  45 struct dsl_dataset;
  46 struct dsl_dir;
  47 struct dsl_pool;
  48 
  49 #define DS_FLAG_INCONSISTENT    (1ULL<<0)
  50 #define DS_IS_INCONSISTENT(ds)  \
  51         ((ds)->ds_phys->ds_flags & DS_FLAG_INCONSISTENT)
  52 
  53 /*
  54  * Do not allow this dataset to be promoted.

  55  */
  56 #define DS_FLAG_NOPROMOTE       (1ULL<<1)
  57 
  58 /*
  59  * DS_FLAG_UNIQUE_ACCURATE is set if ds_unique_bytes has been correctly
  60  * calculated for head datasets (starting with SPA_VERSION_UNIQUE_ACCURATE,
  61  * refquota/refreservations).
  62  */
  63 #define DS_FLAG_UNIQUE_ACCURATE (1ULL<<2)
  64 
  65 /*
  66  * DS_FLAG_DEFER_DESTROY is set after 'zfs destroy -d' has been called
  67  * on a dataset. This allows the dataset to be destroyed using 'zfs release'.
  68  */
  69 #define DS_FLAG_DEFER_DESTROY   (1ULL<<3)
  70 #define DS_IS_DEFER_DESTROY(ds) \
  71         ((ds)->ds_phys->ds_flags & DS_FLAG_DEFER_DESTROY)
  72 
  73 /*
  74  * DS_FIELD_* are strings that are used in the "extensified" dataset zap object.
  75  * They should be of the format <reverse-dns>:<field>.
  76  */
  77 
  78 /*
  79  * DS_FLAG_CI_DATASET is set if the dataset contains a file system whose
  80  * name lookups should be performed case-insensitively.
  81  */
  82 #define DS_FLAG_CI_DATASET      (1ULL<<16)
  83 
  84 #define DS_CREATE_FLAG_NODIRTY  (1ULL<<24)
  85 
  86 typedef struct dsl_dataset_phys {
  87         uint64_t ds_dir_obj;            /* DMU_OT_DSL_DIR */
  88         uint64_t ds_prev_snap_obj;      /* DMU_OT_DSL_DATASET */
  89         uint64_t ds_prev_snap_txg;
  90         uint64_t ds_next_snap_obj;      /* DMU_OT_DSL_DATASET */
  91         uint64_t ds_snapnames_zapobj;   /* DMU_OT_DSL_DS_SNAP_MAP 0 for snaps */
  92         uint64_t ds_num_children;       /* clone/snap children; ==0 for head */
  93         uint64_t ds_creation_time;      /* seconds since 1970 */
  94         uint64_t ds_creation_txg;
  95         uint64_t ds_deadlist_obj;       /* DMU_OT_DEADLIST */
  96         /*
  97          * ds_referenced_bytes, ds_compressed_bytes, and ds_uncompressed_bytes
  98          * include all blocks referenced by this dataset, including those