summaryrefslogtreecommitdiffstats
path: root/module/zfs/dsl_prop.c
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 /module/zfs/dsl_prop.c
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 'module/zfs/dsl_prop.c')
-rw-r--r--module/zfs/dsl_prop.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/module/zfs/dsl_prop.c b/module/zfs/dsl_prop.c
index cd5891864..95e0fa6e3 100644
--- a/module/zfs/dsl_prop.c
+++ b/module/zfs/dsl_prop.c
@@ -105,8 +105,8 @@ dsl_prop_get_dd(dsl_dir_t *dd, const char *propname,
}
/* Check for a local value. */
- err = zap_lookup(mos, dd->dd_phys->dd_props_zapobj, propname,
- intsz, numints, buf);
+ err = zap_lookup(mos, dsl_dir_phys(dd)->dd_props_zapobj,
+ propname, intsz, numints, buf);
if (err != ENOENT) {
if (setpoint != NULL && err == 0)
dsl_dir_name(dd, setpoint);
@@ -117,14 +117,14 @@ dsl_prop_get_dd(dsl_dir_t *dd, const char *propname,
* Skip the check for a received value if there is an explicit
* inheritance entry.
*/
- err = zap_contains(mos, dd->dd_phys->dd_props_zapobj,
+ err = zap_contains(mos, dsl_dir_phys(dd)->dd_props_zapobj,
inheritstr);
if (err != 0 && err != ENOENT)
break;
if (err == ENOENT) {
/* Check for a received value. */
- err = zap_lookup(mos, dd->dd_phys->dd_props_zapobj,
+ err = zap_lookup(mos, dsl_dir_phys(dd)->dd_props_zapobj,
recvdstr, intsz, numints, buf);
if (err != ENOENT) {
if (setpoint != NULL && err == 0) {
@@ -169,7 +169,7 @@ dsl_prop_get_ds(dsl_dataset_t *ds, const char *propname,
ASSERT(dsl_pool_config_held(ds->ds_dir->dd_pool));
inheritable = (prop == ZPROP_INVAL || zfs_prop_inheritable(prop));
snapshot = dsl_dataset_is_snapshot(ds);
- zapobj = ds->ds_phys->ds_props_obj;
+ zapobj = dsl_dataset_phys(ds)->ds_props_obj;
if (zapobj != 0) {
objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset;
@@ -327,7 +327,7 @@ dsl_prop_predict(dsl_dir_t *dd, const char *propname,
}
mos = dd->dd_pool->dp_meta_objset;
- zapobj = dd->dd_phys->dd_props_zapobj;
+ zapobj = dsl_dir_phys(dd)->dd_props_zapobj;
recvdstr = kmem_asprintf("%s%s", propname, ZPROP_RECVD_SUFFIX);
version = spa_version(dd->dd_pool->dp_spa);
@@ -486,7 +486,8 @@ dsl_prop_changed_notify(dsl_pool_t *dp, uint64_t ddobj,
* If the prop is set here, then this change is not
* being inherited here or below; stop the recursion.
*/
- err = zap_contains(mos, dd->dd_phys->dd_props_zapobj, propname);
+ err = zap_contains(mos, dsl_dir_phys(dd)->dd_props_zapobj,
+ propname);
if (err == 0) {
dsl_dir_rele(dd, FTAG);
return;
@@ -497,7 +498,7 @@ dsl_prop_changed_notify(dsl_pool_t *dp, uint64_t ddobj,
mutex_enter(&dd->dd_lock);
for (cbr = list_head(&dd->dd_prop_cbs); cbr;
cbr = list_next(&dd->dd_prop_cbs, cbr)) {
- uint64_t propobj = cbr->cbr_ds->ds_phys->ds_props_obj;
+ uint64_t propobj = dsl_dataset_phys(cbr->cbr_ds)->ds_props_obj;
if (strcmp(cbr->cbr_propname, propname) != 0)
continue;
@@ -515,7 +516,7 @@ dsl_prop_changed_notify(dsl_pool_t *dp, uint64_t ddobj,
za = kmem_alloc(sizeof (zap_attribute_t), KM_SLEEP);
for (zap_cursor_init(&zc, mos,
- dd->dd_phys->dd_child_dir_zapobj);
+ dsl_dir_phys(dd)->dd_child_dir_zapobj);
zap_cursor_retrieve(&zc, za) == 0;
zap_cursor_advance(&zc)) {
dsl_prop_changed_notify(dp, za->za_first_integer,
@@ -546,15 +547,15 @@ dsl_prop_set_sync_impl(dsl_dataset_t *ds, const char *propname,
if (dsl_dataset_is_snapshot(ds)) {
ASSERT(version >= SPA_VERSION_SNAP_PROPS);
- if (ds->ds_phys->ds_props_obj == 0) {
+ if (dsl_dataset_phys(ds)->ds_props_obj == 0) {
dmu_buf_will_dirty(ds->ds_dbuf, tx);
- ds->ds_phys->ds_props_obj =
+ dsl_dataset_phys(ds)->ds_props_obj =
zap_create(mos,
DMU_OT_DSL_PROPS, DMU_OT_NONE, 0, tx);
}
- zapobj = ds->ds_phys->ds_props_obj;
+ zapobj = dsl_dataset_phys(ds)->ds_props_obj;
} else {
- zapobj = ds->ds_dir->dd_phys->dd_props_zapobj;
+ zapobj = dsl_dir_phys(ds->ds_dir)->dd_props_zapobj;
}
if (version < SPA_VERSION_RECVD_PROPS) {
@@ -987,11 +988,11 @@ dsl_prop_get_all_ds(dsl_dataset_t *ds, nvlist_t **nvp,
ASSERT(dsl_pool_config_held(dp));
- if (ds->ds_phys->ds_props_obj != 0) {
+ if (dsl_dataset_phys(ds)->ds_props_obj != 0) {
ASSERT(flags & DSL_PROP_GET_SNAPSHOT);
dsl_dataset_name(ds, setpoint);
- err = dsl_prop_get_all_impl(mos, ds->ds_phys->ds_props_obj,
- setpoint, flags, *nvp);
+ err = dsl_prop_get_all_impl(mos,
+ dsl_dataset_phys(ds)->ds_props_obj, setpoint, flags, *nvp);
if (err)
goto out;
}
@@ -1004,8 +1005,8 @@ dsl_prop_get_all_ds(dsl_dataset_t *ds, nvlist_t **nvp,
flags |= DSL_PROP_GET_INHERITING;
}
dsl_dir_name(dd, setpoint);
- err = dsl_prop_get_all_impl(mos, dd->dd_phys->dd_props_zapobj,
- setpoint, flags, *nvp);
+ err = dsl_prop_get_all_impl(mos,
+ dsl_dir_phys(dd)->dd_props_zapobj, setpoint, flags, *nvp);
if (err)
break;
}