Illumos 5310 - Remove always true tests for non-NULL ds->ds_phys

5310 Remove always true tests for non-NULL ds->ds_phys
Author: Justin T. Gibbs <justing@spectralogic.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Will Andrews <willa@spectralogic.com>
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Approved by: Dan McDonald <danmcd@omniti.com>

References:
  https://www.illumos.org/issues/5310
  https://github.com/illumos/illumos-gate/commit/d808a4f

Ported-by: Chris Dunlop <chris@onthe.net.au>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
Justin T. Gibbs 2015-04-02 02:13:28 +11:00 committed by Brian Behlendorf
parent 9925c28cde
commit 945dd93525
2 changed files with 7 additions and 9 deletions

View File

@ -618,16 +618,14 @@ dsl_dataset_rele(dsl_dataset_t *ds, void *tag)
void void
dsl_dataset_disown(dsl_dataset_t *ds, void *tag) dsl_dataset_disown(dsl_dataset_t *ds, void *tag)
{ {
ASSERT(ds->ds_owner == tag && ds->ds_dbuf != NULL); ASSERT3P(ds->ds_owner, ==, tag);
ASSERT(ds->ds_dbuf != NULL);
mutex_enter(&ds->ds_lock); mutex_enter(&ds->ds_lock);
ds->ds_owner = NULL; ds->ds_owner = NULL;
mutex_exit(&ds->ds_lock); mutex_exit(&ds->ds_lock);
dsl_dataset_long_rele(ds, tag); dsl_dataset_long_rele(ds, tag);
if (ds->ds_dbuf != NULL)
dsl_dataset_rele(ds, tag); dsl_dataset_rele(ds, tag);
else
dsl_dataset_evict(NULL, ds);
} }
boolean_t boolean_t

View File

@ -168,8 +168,8 @@ dsl_prop_get_ds(dsl_dataset_t *ds, const char *propname,
ASSERT(dsl_pool_config_held(ds->ds_dir->dd_pool)); ASSERT(dsl_pool_config_held(ds->ds_dir->dd_pool));
inheritable = (prop == ZPROP_INVAL || zfs_prop_inheritable(prop)); inheritable = (prop == ZPROP_INVAL || zfs_prop_inheritable(prop));
snapshot = (ds->ds_phys != NULL && dsl_dataset_is_snapshot(ds)); snapshot = dsl_dataset_is_snapshot(ds);
zapobj = (ds->ds_phys == NULL ? 0 : ds->ds_phys->ds_props_obj); zapobj = ds->ds_phys->ds_props_obj;
if (zapobj != 0) { if (zapobj != 0) {
objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset; objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset;
@ -544,7 +544,7 @@ dsl_prop_set_sync_impl(dsl_dataset_t *ds, const char *propname,
isint = (dodefault(propname, 8, 1, &intval) == 0); isint = (dodefault(propname, 8, 1, &intval) == 0);
if (ds->ds_phys != NULL && dsl_dataset_is_snapshot(ds)) { if (dsl_dataset_is_snapshot(ds)) {
ASSERT(version >= SPA_VERSION_SNAP_PROPS); ASSERT(version >= SPA_VERSION_SNAP_PROPS);
if (ds->ds_phys->ds_props_obj == 0) { if (ds->ds_phys->ds_props_obj == 0) {
dmu_buf_will_dirty(ds->ds_dbuf, tx); dmu_buf_will_dirty(ds->ds_dbuf, tx);
@ -641,7 +641,7 @@ dsl_prop_set_sync_impl(dsl_dataset_t *ds, const char *propname,
if (isint) { if (isint) {
VERIFY0(dsl_prop_get_int_ds(ds, propname, &intval)); VERIFY0(dsl_prop_get_int_ds(ds, propname, &intval));
if (ds->ds_phys != NULL && dsl_dataset_is_snapshot(ds)) { if (dsl_dataset_is_snapshot(ds)) {
dsl_prop_cb_record_t *cbr; dsl_prop_cb_record_t *cbr;
/* /*
* It's a snapshot; nothing can inherit this * It's a snapshot; nothing can inherit this