aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys/dsl_dataset.h
diff options
context:
space:
mode:
authorJustin T. Gibbs <[email protected]>2015-04-02 02:14:34 +1100
committerBrian Behlendorf <[email protected]>2015-04-28 16:25:20 -0700
commitd683ddbb7272a179da3918cc4f922d92a2195ba2 (patch)
tree82e1d7a9e0a269de978e2d3d07fa785db63961f7 /include/sys/dsl_dataset.h
parent945dd93525d6e33f822beb44e3a3076c8bc89f86 (diff)
Illumos 5314 - Remove "dbuf phys" db->db_data pointer aliases in ZFS
5314 Remove "dbuf phys" db->db_data pointer aliases in ZFS Author: Justin T. Gibbs <[email protected]> Reviewed by: Andriy Gapon <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: Will Andrews <[email protected]> Approved by: Dan McDonald <[email protected]> References: https://www.illumos.org/issues/5314 https://github.com/illumos/illumos-gate/commit/c137962 Ported-by: Chris Dunlop <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'include/sys/dsl_dataset.h')
-rw-r--r--include/sys/dsl_dataset.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/include/sys/dsl_dataset.h b/include/sys/dsl_dataset.h
index 2d8987006..c6280f2b8 100644
--- a/include/sys/dsl_dataset.h
+++ b/include/sys/dsl_dataset.h
@@ -48,7 +48,7 @@ struct dsl_pool;
#define DS_FLAG_INCONSISTENT (1ULL<<0)
#define DS_IS_INCONSISTENT(ds) \
- ((ds)->ds_phys->ds_flags & DS_FLAG_INCONSISTENT)
+ (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_INCONSISTENT)
/*
* Do not allow this dataset to be promoted.
@@ -68,7 +68,7 @@ struct dsl_pool;
*/
#define DS_FLAG_DEFER_DESTROY (1ULL<<3)
#define DS_IS_DEFER_DESTROY(ds) \
- ((ds)->ds_phys->ds_flags & DS_FLAG_DEFER_DESTROY)
+ (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_DEFER_DESTROY)
/*
* DS_FIELD_* are strings that are used in the "extensified" dataset zap object.
@@ -127,7 +127,6 @@ typedef struct dsl_dataset_phys {
typedef struct dsl_dataset {
/* Immutable: */
struct dsl_dir *ds_dir;
- dsl_dataset_phys_t *ds_phys;
dmu_buf_t *ds_dbuf;
uint64_t ds_object;
uint64_t ds_fsid_guid;
@@ -177,17 +176,26 @@ typedef struct dsl_dataset {
char ds_snapname[MAXNAMELEN];
} dsl_dataset_t;
+static inline dsl_dataset_phys_t *
+dsl_dataset_phys(dsl_dataset_t *ds)
+{
+ return (ds->ds_dbuf->db_data);
+}
+
/*
* The max length of a temporary tag prefix is the number of hex digits
* required to express UINT64_MAX plus one for the hyphen.
*/
#define MAX_TAG_PREFIX_LEN 17
-#define dsl_dataset_is_snapshot(ds) \
- ((ds)->ds_phys->ds_num_children != 0)
+static inline boolean_t
+dsl_dataset_is_snapshot(dsl_dataset_t *ds)
+{
+ return (dsl_dataset_phys(ds)->ds_num_children != 0);
+}
#define DS_UNIQUE_IS_ACCURATE(ds) \
- (((ds)->ds_phys->ds_flags & DS_FLAG_UNIQUE_ACCURATE) != 0)
+ ((dsl_dataset_phys(ds)->ds_flags & DS_FLAG_UNIQUE_ACCURATE) != 0)
int dsl_dataset_hold(struct dsl_pool *dp, const char *name, void *tag,
dsl_dataset_t **dsp);