Skip to content

Commit 945dd93

Browse files
Justin T. Gibbsbehlendorf
authored andcommitted
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 illumos/illumos-gate@d808a4f Ported-by: Chris Dunlop <chris@onthe.net.au> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
1 parent 9925c28 commit 945dd93

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

module/zfs/dsl_dataset.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -618,16 +618,14 @@ dsl_dataset_rele(dsl_dataset_t *ds, void *tag)
618618
void
619619
dsl_dataset_disown(dsl_dataset_t *ds, void *tag)
620620
{
621-
ASSERT(ds->ds_owner == tag && ds->ds_dbuf != NULL);
621+
ASSERT3P(ds->ds_owner, ==, tag);
622+
ASSERT(ds->ds_dbuf != NULL);
622623

623624
mutex_enter(&ds->ds_lock);
624625
ds->ds_owner = NULL;
625626
mutex_exit(&ds->ds_lock);
626627
dsl_dataset_long_rele(ds, tag);
627-
if (ds->ds_dbuf != NULL)
628-
dsl_dataset_rele(ds, tag);
629-
else
630-
dsl_dataset_evict(NULL, ds);
628+
dsl_dataset_rele(ds, tag);
631629
}
632630

633631
boolean_t

module/zfs/dsl_prop.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ dsl_prop_get_ds(dsl_dataset_t *ds, const char *propname,
168168

169169
ASSERT(dsl_pool_config_held(ds->ds_dir->dd_pool));
170170
inheritable = (prop == ZPROP_INVAL || zfs_prop_inheritable(prop));
171-
snapshot = (ds->ds_phys != NULL && dsl_dataset_is_snapshot(ds));
172-
zapobj = (ds->ds_phys == NULL ? 0 : ds->ds_phys->ds_props_obj);
171+
snapshot = dsl_dataset_is_snapshot(ds);
172+
zapobj = ds->ds_phys->ds_props_obj;
173173

174174
if (zapobj != 0) {
175175
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,
544544

545545
isint = (dodefault(propname, 8, 1, &intval) == 0);
546546

547-
if (ds->ds_phys != NULL && dsl_dataset_is_snapshot(ds)) {
547+
if (dsl_dataset_is_snapshot(ds)) {
548548
ASSERT(version >= SPA_VERSION_SNAP_PROPS);
549549
if (ds->ds_phys->ds_props_obj == 0) {
550550
dmu_buf_will_dirty(ds->ds_dbuf, tx);
@@ -641,7 +641,7 @@ dsl_prop_set_sync_impl(dsl_dataset_t *ds, const char *propname,
641641
if (isint) {
642642
VERIFY0(dsl_prop_get_int_ds(ds, propname, &intval));
643643

644-
if (ds->ds_phys != NULL && dsl_dataset_is_snapshot(ds)) {
644+
if (dsl_dataset_is_snapshot(ds)) {
645645
dsl_prop_cb_record_t *cbr;
646646
/*
647647
* It's a snapshot; nothing can inherit this

0 commit comments

Comments
 (0)