aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/dsl_userhold.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_userhold.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_userhold.c')
-rw-r--r--module/zfs/dsl_userhold.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/module/zfs/dsl_userhold.c b/module/zfs/dsl_userhold.c
index 1d6c9df89..e2318d03b 100644
--- a/module/zfs/dsl_userhold.c
+++ b/module/zfs/dsl_userhold.c
@@ -64,10 +64,10 @@ dsl_dataset_user_hold_check_one(dsl_dataset_t *ds, const char *htag,
return (SET_ERROR(E2BIG));
/* tags must be unique (if ds already exists) */
- if (ds != NULL && ds->ds_phys->ds_userrefs_obj != 0) {
+ if (ds != NULL && dsl_dataset_phys(ds)->ds_userrefs_obj != 0) {
uint64_t value;
- error = zap_lookup(mos, ds->ds_phys->ds_userrefs_obj,
+ error = zap_lookup(mos, dsl_dataset_phys(ds)->ds_userrefs_obj,
htag, 8, 1, &value);
if (error == 0)
error = SET_ERROR(EEXIST);
@@ -141,16 +141,16 @@ dsl_dataset_user_hold_sync_one_impl(nvlist_t *tmpholds, dsl_dataset_t *ds,
ASSERT(RRW_WRITE_HELD(&dp->dp_config_rwlock));
- if (ds->ds_phys->ds_userrefs_obj == 0) {
+ if (dsl_dataset_phys(ds)->ds_userrefs_obj == 0) {
/*
* This is the first user hold for this dataset. Create
* the userrefs zap object.
*/
dmu_buf_will_dirty(ds->ds_dbuf, tx);
- zapobj = ds->ds_phys->ds_userrefs_obj =
+ zapobj = dsl_dataset_phys(ds)->ds_userrefs_obj =
zap_create(mos, DMU_OT_USERREFS, DMU_OT_NONE, 0, tx);
} else {
- zapobj = ds->ds_phys->ds_userrefs_obj;
+ zapobj = dsl_dataset_phys(ds)->ds_userrefs_obj;
}
ds->ds_userrefs++;
@@ -362,7 +362,7 @@ dsl_dataset_user_release_check_one(dsl_dataset_user_release_arg_t *ddura,
numholds = 0;
mos = ds->ds_dir->dd_pool->dp_meta_objset;
- zapobj = ds->ds_phys->ds_userrefs_obj;
+ zapobj = dsl_dataset_phys(ds)->ds_userrefs_obj;
VERIFY0(nvlist_alloc(&holds_found, NV_UNIQUE_NAME, KM_SLEEP));
for (pair = nvlist_next_nvpair(holds, NULL); pair != NULL;
@@ -400,7 +400,8 @@ dsl_dataset_user_release_check_one(dsl_dataset_user_release_arg_t *ddura,
numholds++;
}
- if (DS_IS_DEFER_DESTROY(ds) && ds->ds_phys->ds_num_children == 1 &&
+ if (DS_IS_DEFER_DESTROY(ds) &&
+ dsl_dataset_phys(ds)->ds_num_children == 1 &&
ds->ds_userrefs == numholds) {
/* we need to destroy the snapshot as well */
if (dsl_dataset_long_held(ds)) {
@@ -488,8 +489,8 @@ dsl_dataset_user_release_sync_one(dsl_dataset_t *ds, nvlist_t *holds,
error = dsl_pool_user_release(dp, ds->ds_object, holdname, tx);
VERIFY(error == 0 || error == ENOENT);
- VERIFY0(zap_remove(mos, ds->ds_phys->ds_userrefs_obj, holdname,
- tx));
+ VERIFY0(zap_remove(mos, dsl_dataset_phys(ds)->ds_userrefs_obj,
+ holdname, tx));
ds->ds_userrefs--;
spa_history_log_internal_ds(ds, "release", tx,
@@ -519,7 +520,7 @@ dsl_dataset_user_release_sync(void *arg, dmu_tx_t *tx)
fnvpair_value_nvlist(pair), tx);
if (nvlist_exists(ddura->ddura_todelete, name)) {
ASSERT(ds->ds_userrefs == 0 &&
- ds->ds_phys->ds_num_children == 1 &&
+ dsl_dataset_phys(ds)->ds_num_children == 1 &&
DS_IS_DEFER_DESTROY(ds));
dsl_destroy_snapshot_sync_impl(ds, B_FALSE, tx);
}
@@ -651,13 +652,13 @@ dsl_dataset_get_holds(const char *dsname, nvlist_t *nvl)
return (err);
}
- if (ds->ds_phys->ds_userrefs_obj != 0) {
+ if (dsl_dataset_phys(ds)->ds_userrefs_obj != 0) {
zap_attribute_t *za;
zap_cursor_t zc;
za = kmem_alloc(sizeof (zap_attribute_t), KM_SLEEP);
for (zap_cursor_init(&zc, ds->ds_dir->dd_pool->dp_meta_objset,
- ds->ds_phys->ds_userrefs_obj);
+ dsl_dataset_phys(ds)->ds_userrefs_obj);
zap_cursor_retrieve(&zc, za) == 0;
zap_cursor_advance(&zc)) {
fnvlist_add_uint64(nvl, za->za_name,