Print this page
3752 want more verifiable dbuf user eviction
Submitted by:   Justin Gibbs <justing@spectralogic.com>
Submitted by:   Will Andrews <willa@spectralogic.com>

@@ -165,12 +165,12 @@
         boolean_t snapshot;
         uint64_t zapobj;
 
         ASSERT(dsl_pool_config_held(ds->ds_dir->dd_pool));
         inheritable = (prop == ZPROP_INVAL || zfs_prop_inheritable(prop));
-        snapshot = (ds->ds_phys != NULL && dsl_dataset_is_snapshot(ds));
-        zapobj = (ds->ds_phys == NULL ? 0 : ds->ds_phys->ds_props_obj);
+        snapshot = (DS_HAS_PHYS(ds) && dsl_dataset_is_snapshot(ds));
+        zapobj = (DS_HAS_PHYS(ds) ? ds->ds_phys->ds_props_obj : 0);
 
         if (zapobj != 0) {
                 objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset;
                 int err;
 

@@ -541,11 +541,11 @@
         int err;
         uint64_t version = spa_version(ds->ds_dir->dd_pool->dp_spa);
 
         isint = (dodefault(propname, 8, 1, &intval) == 0);
 
-        if (ds->ds_phys != NULL && dsl_dataset_is_snapshot(ds)) {
+        if (DS_HAS_PHYS(ds) && dsl_dataset_is_snapshot(ds)) {
                 ASSERT(version >= SPA_VERSION_SNAP_PROPS);
                 if (ds->ds_phys->ds_props_obj == 0) {
                         dmu_buf_will_dirty(ds->ds_dbuf, tx);
                         ds->ds_phys->ds_props_obj =
                             zap_create(mos,

@@ -642,11 +642,11 @@
         strfree(recvdstr);
 
         if (isint) {
                 VERIFY0(dsl_prop_get_int_ds(ds, propname, &intval));
 
-                if (ds->ds_phys != NULL && dsl_dataset_is_snapshot(ds)) {
+                if (DS_HAS_PHYS(ds) && dsl_dataset_is_snapshot(ds)) {
                         dsl_prop_cb_record_t *cbr;
                         /*
                          * It's a snapshot; nothing can inherit this
                          * property, so just look for callbacks on this
                          * ds here.