Date: Wed, 10 Dec 2014 13:29:24 -0700 From: "Justin T. Gibbs" <gibbs@scsiguy.com> To: Xin LI <delphij@freebsd.org> Cc: svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-vendor@freebsd.org, will@FreeBSD.org Subject: Re: svn commit: r275551 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb Message-ID: <E38DF16A-2834-4E80-BBCF-703B327EDC88@scsiguy.com> In-Reply-To: <201412060050.sB60oxYu045859@svn.freebsd.org> References: <201412060050.sB60oxYu045859@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
What=E2=80=99s the policy for the commit log on vendor imports from = illumos? Since illumos does not allow =E2=80=9CFreeBSD style=E2=80=9D = commit messages, I=E2=80=99ve been putting that data into the = corresponding illumos issue that I create. So this information isn=E2=80=99= t lost during the merge to FreeBSD, I think we should pull the issue = data into our commit messages in addition to data taken from the git = commit in illumos-gate. One minor gripe about the illumos issue tracker is that I=E2=80=99ve = found it hard to keep it from mangling the formatting of text. For = example, look at the commit log I put into the history section of = https://www.illumos.org/issues/5314. Instead of fighting with that, = I=E2=80=99ve been pushing my =E2=80=9CFreeBSD commit log=E2=80=9D as the = description of the review associated with the bug and just linking the = issue to the review. You can see that in the next big change from = Spectra that is currently going through the review process: https://www.illumos.org/issues/5056 https://reviews.csiden.org/r/131/ =E2=80=94 Justin > On Dec 5, 2014, at 5:50 PM, Xin LI <delphij@freebsd.org> wrote: >=20 > Author: delphij > Date: Sat Dec 6 00:50:57 2014 > New Revision: 275551 > URL: https://svnweb.freebsd.org/changeset/base/275551 >=20 > Log: > 5314 Remove "dbuf phys" db->db_data pointer aliases in ZFS > Reviewed by: Andriy Gapon <avg@freebsd.org> > Reviewed by: Matthew Ahrens <mahrens@delphix.com> > Reviewed by: Will Andrews <willa@spectralogic.com> > Approved by: Dan McDonald <danmcd@omniti.com> > Author: Justin T. Gibbs <justing@spectralogic.com> >=20 > illumos/illumos-gate@c1379625401dfbe1c39b79136dd384a571d47fde >=20 > Modified: > vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c > vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c > vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c > vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c > vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c > vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c > vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c > vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_bookmark.c > vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c > vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c > vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deleg.c > vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c > vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c > vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c > vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_prop.c > vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c > vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_synctask.c > vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_userhold.c > vendor-sys/illumos/dist/uts/common/fs/zfs/sa.c > vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c > vendor-sys/illumos/dist/uts/common/fs/zfs/spa_history.c > vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h > vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h > vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h > vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dir.h > vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap_impl.h > vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap_leaf.h > vendor-sys/illumos/dist/uts/common/fs/zfs/zap.c > vendor-sys/illumos/dist/uts/common/fs/zfs/zap_leaf.c > vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c > vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c >=20 > Changes in other areas also in this revision: > Modified: > vendor/illumos/dist/cmd/zdb/zdb.c >=20 > Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Sat Dec 6 = 00:47:31 2014 (r275550) > +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Sat Dec 6 = 00:50:57 2014 (r275551) > @@ -223,11 +223,8 @@ dbuf_evict_user(dmu_buf_impl_t *db) > if (db->db_level !=3D 0 || db->db_evict_func =3D=3D NULL) > return; >=20 > - if (db->db_user_data_ptr_ptr) > - *db->db_user_data_ptr_ptr =3D db->db.db_data; > db->db_evict_func(&db->db, db->db_user_ptr); > db->db_user_ptr =3D NULL; > - db->db_user_data_ptr_ptr =3D NULL; > db->db_evict_func =3D NULL; > } >=20 > @@ -418,16 +415,6 @@ dbuf_verify(dmu_buf_impl_t *db) > #endif >=20 > static void > -dbuf_update_data(dmu_buf_impl_t *db) > -{ > - ASSERT(MUTEX_HELD(&db->db_mtx)); > - if (db->db_level =3D=3D 0 && db->db_user_data_ptr_ptr) { > - ASSERT(!refcount_is_zero(&db->db_holds)); > - *db->db_user_data_ptr_ptr =3D db->db.db_data; > - } > -} > - > -static void > dbuf_set_data(dmu_buf_impl_t *db, arc_buf_t *buf) > { > ASSERT(MUTEX_HELD(&db->db_mtx)); > @@ -437,7 +424,6 @@ dbuf_set_data(dmu_buf_impl_t *db, arc_bu > db->db.db_data =3D buf->b_data; > if (!arc_released(buf)) > arc_set_callback(buf, dbuf_do_evict, db); > - dbuf_update_data(db); > } else { > dbuf_evict_user(db); > db->db.db_data =3D NULL; > @@ -543,7 +529,6 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t > if (bonuslen) > bcopy(DN_BONUS(dn->dn_phys), db->db.db_data, = bonuslen); > DB_DNODE_EXIT(db); > - dbuf_update_data(db); > db->db_state =3D DB_CACHED; > mutex_exit(&db->db_mtx); > return; > @@ -1726,7 +1711,6 @@ dbuf_create(dnode_t *dn, uint8_t level,=20 > db->db_blkptr =3D blkptr; >=20 > db->db_user_ptr =3D NULL; > - db->db_user_data_ptr_ptr =3D NULL; > db->db_evict_func =3D NULL; > db->db_immediate_evict =3D 0; > db->db_freed_in_flight =3D 0; > @@ -1971,7 +1955,6 @@ top: > } >=20 > (void) refcount_add(&db->db_holds, tag); > - dbuf_update_data(db); > DBUF_VERIFY(db); > mutex_exit(&db->db_mtx); >=20 > @@ -2182,27 +2165,25 @@ dbuf_refcount(dmu_buf_impl_t *db) > } >=20 > void * > -dmu_buf_set_user(dmu_buf_t *db_fake, void *user_ptr, void = *user_data_ptr_ptr, > +dmu_buf_set_user(dmu_buf_t *db_fake, void *user_ptr, > dmu_buf_evict_func_t *evict_func) > { > - return (dmu_buf_update_user(db_fake, NULL, user_ptr, > - user_data_ptr_ptr, evict_func)); > + return (dmu_buf_update_user(db_fake, NULL, user_ptr, = evict_func)); > } >=20 > void * > -dmu_buf_set_user_ie(dmu_buf_t *db_fake, void *user_ptr, void = *user_data_ptr_ptr, > +dmu_buf_set_user_ie(dmu_buf_t *db_fake, void *user_ptr, > dmu_buf_evict_func_t *evict_func) > { > dmu_buf_impl_t *db =3D (dmu_buf_impl_t *)db_fake; >=20 > db->db_immediate_evict =3D TRUE; > - return (dmu_buf_update_user(db_fake, NULL, user_ptr, > - user_data_ptr_ptr, evict_func)); > + return (dmu_buf_update_user(db_fake, NULL, user_ptr, = evict_func)); > } >=20 > void * > dmu_buf_update_user(dmu_buf_t *db_fake, void *old_user_ptr, void = *user_ptr, > - void *user_data_ptr_ptr, dmu_buf_evict_func_t *evict_func) > + dmu_buf_evict_func_t *evict_func) > { > dmu_buf_impl_t *db =3D (dmu_buf_impl_t *)db_fake; > ASSERT(db->db_level =3D=3D 0); > @@ -2213,10 +2194,7 @@ dmu_buf_update_user(dmu_buf_t *db_fake,=20 >=20 > if (db->db_user_ptr =3D=3D old_user_ptr) { > db->db_user_ptr =3D user_ptr; > - db->db_user_data_ptr_ptr =3D user_data_ptr_ptr; > db->db_evict_func =3D evict_func; > - > - dbuf_update_data(db); > } else { > old_user_ptr =3D db->db_user_ptr; > } >=20 > Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c Sat Dec = 6 00:47:31 2014 (r275550) > +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c Sat Dec = 6 00:50:57 2014 (r275551) > @@ -194,7 +194,7 @@ dmu_diff(const char *tosnap_name, const=20 > return (SET_ERROR(EXDEV)); > } >=20 > - fromtxg =3D fromsnap->ds_phys->ds_creation_txg; > + fromtxg =3D dsl_dataset_phys(fromsnap)->ds_creation_txg; > dsl_dataset_rele(fromsnap, FTAG); >=20 > dsl_dataset_long_hold(tosnap, FTAG); >=20 > Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Sat Dec = 6 00:47:31 2014 (r275550) > +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Sat Dec = 6 00:50:57 2014 (r275551) > @@ -1479,12 +1479,12 @@ dmu_snapshot_realname(objset_t *os, char > dsl_dataset_t *ds =3D os->os_dsl_dataset; > uint64_t ignored; >=20 > - if (ds->ds_phys->ds_snapnames_zapobj =3D=3D 0) > + if (dsl_dataset_phys(ds)->ds_snapnames_zapobj =3D=3D 0) > return (SET_ERROR(ENOENT)); >=20 > return (zap_lookup_norm(ds->ds_dir->dd_pool->dp_meta_objset, > - ds->ds_phys->ds_snapnames_zapobj, name, 8, 1, &ignored, = MT_FIRST, > - real, maxlen, conflict)); > + dsl_dataset_phys(ds)->ds_snapnames_zapobj, name, 8, 1, = &ignored, > + MT_FIRST, real, maxlen, conflict)); > } >=20 > int > @@ -1497,12 +1497,12 @@ dmu_snapshot_list_next(objset_t *os, int >=20 > ASSERT(dsl_pool_config_held(dmu_objset_pool(os))); >=20 > - if (ds->ds_phys->ds_snapnames_zapobj =3D=3D 0) > + if (dsl_dataset_phys(ds)->ds_snapnames_zapobj =3D=3D 0) > return (SET_ERROR(ENOENT)); >=20 > zap_cursor_init_serialized(&cursor, > ds->ds_dir->dd_pool->dp_meta_objset, > - ds->ds_phys->ds_snapnames_zapobj, *offp); > + dsl_dataset_phys(ds)->ds_snapnames_zapobj, *offp); >=20 > if (zap_cursor_retrieve(&cursor, &attr) !=3D 0) { > zap_cursor_fini(&cursor); > @@ -1536,12 +1536,12 @@ dmu_dir_list_next(objset_t *os, int name >=20 > /* there is no next dir on a snapshot! */ > if (os->os_dsl_dataset->ds_object !=3D > - dd->dd_phys->dd_head_dataset_obj) > + dsl_dir_phys(dd)->dd_head_dataset_obj) > return (SET_ERROR(ENOENT)); >=20 > zap_cursor_init_serialized(&cursor, > dd->dd_pool->dp_meta_objset, > - dd->dd_phys->dd_child_dir_zapobj, *offp); > + dsl_dir_phys(dd)->dd_child_dir_zapobj, *offp); >=20 > if (zap_cursor_retrieve(&cursor, &attr) !=3D 0) { > zap_cursor_fini(&cursor); > @@ -1589,7 +1589,7 @@ dmu_objset_find_dp(dsl_pool_t *dp, uint6 > return (0); > } >=20 > - thisobj =3D dd->dd_phys->dd_head_dataset_obj; > + thisobj =3D dsl_dir_phys(dd)->dd_head_dataset_obj; > attr =3D kmem_alloc(sizeof (zap_attribute_t), KM_SLEEP); >=20 > /* > @@ -1597,7 +1597,7 @@ dmu_objset_find_dp(dsl_pool_t *dp, uint6 > */ > if (flags & DS_FIND_CHILDREN) { > for (zap_cursor_init(&zc, dp->dp_meta_objset, > - dd->dd_phys->dd_child_dir_zapobj); > + dsl_dir_phys(dd)->dd_child_dir_zapobj); > zap_cursor_retrieve(&zc, attr) =3D=3D 0; > (void) zap_cursor_advance(&zc)) { > ASSERT3U(attr->za_integer_length, =3D=3D, > @@ -1626,7 +1626,9 @@ dmu_objset_find_dp(dsl_pool_t *dp, uint6 > err =3D dsl_dataset_hold_obj(dp, thisobj, FTAG, &ds); >=20 > if (err =3D=3D 0) { > - uint64_t snapobj =3D = ds->ds_phys->ds_snapnames_zapobj; > + uint64_t snapobj; > + > + snapobj =3D = dsl_dataset_phys(ds)->ds_snapnames_zapobj; > dsl_dataset_rele(ds, FTAG); >=20 > for (zap_cursor_init(&zc, dp->dp_meta_objset, = snapobj); > @@ -1701,7 +1703,7 @@ dmu_objset_find_impl(spa_t *spa, const c > return (0); > } >=20 > - thisobj =3D dd->dd_phys->dd_head_dataset_obj; > + thisobj =3D dsl_dir_phys(dd)->dd_head_dataset_obj; > attr =3D kmem_alloc(sizeof (zap_attribute_t), KM_SLEEP); >=20 > /* > @@ -1709,7 +1711,7 @@ dmu_objset_find_impl(spa_t *spa, const c > */ > if (flags & DS_FIND_CHILDREN) { > for (zap_cursor_init(&zc, dp->dp_meta_objset, > - dd->dd_phys->dd_child_dir_zapobj); > + dsl_dir_phys(dd)->dd_child_dir_zapobj); > zap_cursor_retrieve(&zc, attr) =3D=3D 0; > (void) zap_cursor_advance(&zc)) { > ASSERT3U(attr->za_integer_length, =3D=3D, > @@ -1742,7 +1744,9 @@ dmu_objset_find_impl(spa_t *spa, const c > err =3D dsl_dataset_hold_obj(dp, thisobj, FTAG, &ds); >=20 > if (err =3D=3D 0) { > - uint64_t snapobj =3D = ds->ds_phys->ds_snapnames_zapobj; > + uint64_t snapobj; > + > + snapobj =3D = dsl_dataset_phys(ds)->ds_snapnames_zapobj; > dsl_dataset_rele(ds, FTAG); >=20 > for (zap_cursor_init(&zc, dp->dp_meta_objset, = snapobj); >=20 > Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Sat Dec = 6 00:47:31 2014 (r275550) > +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Sat Dec = 6 00:50:57 2014 (r275551) > @@ -598,12 +598,12 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, > featureflags); >=20 > drr->drr_u.drr_begin.drr_creation_time =3D > - ds->ds_phys->ds_creation_time; > + dsl_dataset_phys(ds)->ds_creation_time; > drr->drr_u.drr_begin.drr_type =3D dmu_objset_type(os); > if (is_clone) > drr->drr_u.drr_begin.drr_flags |=3D DRR_FLAG_CLONE; > - drr->drr_u.drr_begin.drr_toguid =3D ds->ds_phys->ds_guid; > - if (ds->ds_phys->ds_flags & DS_FLAG_CI_DATASET) > + drr->drr_u.drr_begin.drr_toguid =3D = dsl_dataset_phys(ds)->ds_guid; > + if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) > drr->drr_u.drr_begin.drr_flags |=3D DRR_FLAG_CI_DATA; >=20 > if (fromzb !=3D NULL) { > @@ -624,7 +624,7 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, > dsp->dsa_proc =3D curproc; > dsp->dsa_os =3D os; > dsp->dsa_off =3D off; > - dsp->dsa_toguid =3D ds->ds_phys->ds_guid; > + dsp->dsa_toguid =3D dsl_dataset_phys(ds)->ds_guid; > ZIO_SET_CHECKSUM(&dsp->dsa_zc, 0, 0, 0, 0); > dsp->dsa_pending_op =3D PENDING_NONE; > dsp->dsa_incremental =3D (fromzb !=3D NULL); > @@ -710,9 +710,10 @@ dmu_send_obj(const char *pool, uint64_t=20 > } > if (!dsl_dataset_is_before(ds, fromds, 0)) > err =3D SET_ERROR(EXDEV); > - zb.zbm_creation_time =3D = fromds->ds_phys->ds_creation_time; > - zb.zbm_creation_txg =3D = fromds->ds_phys->ds_creation_txg; > - zb.zbm_guid =3D fromds->ds_phys->ds_guid; > + zb.zbm_creation_time =3D > + dsl_dataset_phys(fromds)->ds_creation_time; > + zb.zbm_creation_txg =3D = dsl_dataset_phys(fromds)->ds_creation_txg; > + zb.zbm_guid =3D dsl_dataset_phys(fromds)->ds_guid; > is_clone =3D (fromds->ds_dir !=3D ds->ds_dir); > dsl_dataset_rele(fromds, FTAG); > err =3D dmu_send_impl(FTAG, dp, ds, &zb, is_clone, > @@ -779,10 +780,10 @@ dmu_send(const char *tosnap, const char=20 > if (!dsl_dataset_is_before(ds, fromds, = 0)) > err =3D SET_ERROR(EXDEV); > zb.zbm_creation_time =3D > - fromds->ds_phys->ds_creation_time; > + = dsl_dataset_phys(fromds)->ds_creation_time; > zb.zbm_creation_txg =3D > - fromds->ds_phys->ds_creation_txg; > - zb.zbm_guid =3D = fromds->ds_phys->ds_guid; > + = dsl_dataset_phys(fromds)->ds_creation_txg; > + zb.zbm_guid =3D = dsl_dataset_phys(fromds)->ds_guid; > is_clone =3D (ds->ds_dir !=3D = fromds->ds_dir); > dsl_dataset_rele(fromds, FTAG); > } > @@ -829,7 +830,7 @@ dmu_send_estimate(dsl_dataset_t *ds, dsl >=20 > /* Get uncompressed size estimate of changed data. */ > if (fromds =3D=3D NULL) { > - size =3D ds->ds_phys->ds_uncompressed_bytes; > + size =3D dsl_dataset_phys(ds)->ds_uncompressed_bytes; > } else { > uint64_t used, comp; > err =3D dsl_dataset_space_written(fromds, ds, > @@ -884,15 +885,15 @@ recv_begin_check_existing_impl(dmu_recv_ >=20 > /* temporary clone name must not exist */ > error =3D zap_lookup(dp->dp_meta_objset, > - ds->ds_dir->dd_phys->dd_child_dir_zapobj, recv_clone_name, > + dsl_dir_phys(ds->ds_dir)->dd_child_dir_zapobj, = recv_clone_name, > 8, 1, &val); > if (error !=3D ENOENT) > return (error =3D=3D 0 ? EBUSY : error); >=20 > /* new snapshot name must not exist */ > error =3D zap_lookup(dp->dp_meta_objset, > - ds->ds_phys->ds_snapnames_zapobj, = drba->drba_cookie->drc_tosnap, > - 8, 1, &val); > + dsl_dataset_phys(ds)->ds_snapnames_zapobj, > + drba->drba_cookie->drc_tosnap, 8, 1, &val); > if (error !=3D ENOENT) > return (error =3D=3D 0 ? EEXIST : error); >=20 > @@ -912,7 +913,7 @@ recv_begin_check_existing_impl(dmu_recv_ >=20 > if (fromguid !=3D 0) { > dsl_dataset_t *snap; > - uint64_t obj =3D ds->ds_phys->ds_prev_snap_obj; > + uint64_t obj =3D dsl_dataset_phys(ds)->ds_prev_snap_obj; >=20 > /* Find snapshot in this dir that matches fromguid. */ > while (obj !=3D 0) { > @@ -924,9 +925,9 @@ recv_begin_check_existing_impl(dmu_recv_ > dsl_dataset_rele(snap, FTAG); > return (SET_ERROR(ENODEV)); > } > - if (snap->ds_phys->ds_guid =3D=3D fromguid) > + if (dsl_dataset_phys(snap)->ds_guid =3D=3D = fromguid) > break; > - obj =3D snap->ds_phys->ds_prev_snap_obj; > + obj =3D = dsl_dataset_phys(snap)->ds_prev_snap_obj; > dsl_dataset_rele(snap, FTAG); > } > if (obj =3D=3D 0) > @@ -949,9 +950,9 @@ recv_begin_check_existing_impl(dmu_recv_ > dsl_dataset_rele(snap, FTAG); > } else { > /* if full, most recent snapshot must be $ORIGIN */ > - if (ds->ds_phys->ds_prev_snap_txg >=3D TXG_INITIAL) > + if (dsl_dataset_phys(ds)->ds_prev_snap_txg >=3D = TXG_INITIAL) > return (SET_ERROR(ENODEV)); > - drba->drba_snapobj =3D ds->ds_phys->ds_prev_snap_obj; > + drba->drba_snapobj =3D = dsl_dataset_phys(ds)->ds_prev_snap_obj; > } >=20 > return (0); > @@ -1069,7 +1070,7 @@ dmu_recv_begin_check(void *arg, dmu_tx_t > dsl_dataset_rele(ds, FTAG); > return (SET_ERROR(EINVAL)); > } > - if (origin->ds_phys->ds_guid !=3D fromguid) { > + if (dsl_dataset_phys(origin)->ds_guid !=3D = fromguid) { > dsl_dataset_rele(origin, FTAG); > dsl_dataset_rele(ds, FTAG); > return (SET_ERROR(ENODEV)); > @@ -1140,7 +1141,7 @@ dmu_recv_begin_sync(void *arg, dmu_tx_t=20 > } >=20 > dmu_buf_will_dirty(newds->ds_dbuf, tx); > - newds->ds_phys->ds_flags |=3D DS_FLAG_INCONSISTENT; > + dsl_dataset_phys(newds)->ds_flags |=3D DS_FLAG_INCONSISTENT; >=20 > /* > * If we actually created a non-clone, we need to create the > @@ -1777,7 +1778,7 @@ dmu_recv_stream(dmu_recv_cookie_t *drc,=20 > */ > VERIFY0(dmu_objset_from_ds(drc->drc_ds, &os)); >=20 > - ASSERT(drc->drc_ds->ds_phys->ds_flags & DS_FLAG_INCONSISTENT); > + ASSERT(dsl_dataset_phys(drc->drc_ds)->ds_flags & = DS_FLAG_INCONSISTENT); >=20 > featureflags =3D = DMU_GET_FEATUREFLAGS(drc->drc_drrb->drr_versioninfo); >=20 > @@ -1940,8 +1941,11 @@ dmu_recv_end_check(void *arg, dmu_tx_t * > * the snap before drc_ds, because drc_ds can = not > * have any snaps of its own). > */ > - uint64_t obj =3D = origin_head->ds_phys->ds_prev_snap_obj; > - while (obj !=3D = drc->drc_ds->ds_phys->ds_prev_snap_obj) { > + uint64_t obj; > + > + obj =3D = dsl_dataset_phys(origin_head)->ds_prev_snap_obj; > + while (obj !=3D > + = dsl_dataset_phys(drc->drc_ds)->ds_prev_snap_obj) { > dsl_dataset_t *snap; > error =3D dsl_dataset_hold_obj(dp, obj, = FTAG, > &snap); > @@ -1953,7 +1957,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * > error =3D = dsl_destroy_snapshot_check_impl( > snap, B_FALSE); > } > - obj =3D snap->ds_phys->ds_prev_snap_obj; > + obj =3D = dsl_dataset_phys(snap)->ds_prev_snap_obj; > dsl_dataset_rele(snap, FTAG); > if (error !=3D 0) > return (error); > @@ -1999,13 +2003,16 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *t > * Destroy any snapshots of drc_tofs = (origin_head) > * after the origin (the snap before drc_ds). > */ > - uint64_t obj =3D = origin_head->ds_phys->ds_prev_snap_obj; > - while (obj !=3D = drc->drc_ds->ds_phys->ds_prev_snap_obj) { > + uint64_t obj; > + > + obj =3D = dsl_dataset_phys(origin_head)->ds_prev_snap_obj; > + while (obj !=3D > + = dsl_dataset_phys(drc->drc_ds)->ds_prev_snap_obj) { > dsl_dataset_t *snap; > VERIFY0(dsl_dataset_hold_obj(dp, obj, = FTAG, > &snap)); > ASSERT3P(snap->ds_dir, =3D=3D, = origin_head->ds_dir); > - obj =3D snap->ds_phys->ds_prev_snap_obj; > + obj =3D = dsl_dataset_phys(snap)->ds_prev_snap_obj; > dsl_destroy_snapshot_sync_impl(snap, > B_FALSE, tx); > dsl_dataset_rele(snap, FTAG); > @@ -2021,15 +2028,16 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *t >=20 > /* set snapshot's creation time and guid */ > dmu_buf_will_dirty(origin_head->ds_prev->ds_dbuf, tx); > - origin_head->ds_prev->ds_phys->ds_creation_time =3D > + dsl_dataset_phys(origin_head->ds_prev)->ds_creation_time = =3D > drc->drc_drrb->drr_creation_time; > - origin_head->ds_prev->ds_phys->ds_guid =3D > + dsl_dataset_phys(origin_head->ds_prev)->ds_guid =3D > drc->drc_drrb->drr_toguid; > - origin_head->ds_prev->ds_phys->ds_flags &=3D > + dsl_dataset_phys(origin_head->ds_prev)->ds_flags &=3D > ~DS_FLAG_INCONSISTENT; >=20 > dmu_buf_will_dirty(origin_head->ds_dbuf, tx); > - origin_head->ds_phys->ds_flags &=3D = ~DS_FLAG_INCONSISTENT; > + dsl_dataset_phys(origin_head)->ds_flags &=3D > + ~DS_FLAG_INCONSISTENT; >=20 > dsl_dataset_rele(origin_head, FTAG); > dsl_destroy_head_sync_impl(drc->drc_ds, tx); > @@ -2043,15 +2051,17 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *t >=20 > /* set snapshot's creation time and guid */ > dmu_buf_will_dirty(ds->ds_prev->ds_dbuf, tx); > - ds->ds_prev->ds_phys->ds_creation_time =3D > + dsl_dataset_phys(ds->ds_prev)->ds_creation_time =3D > drc->drc_drrb->drr_creation_time; > - ds->ds_prev->ds_phys->ds_guid =3D = drc->drc_drrb->drr_toguid; > - ds->ds_prev->ds_phys->ds_flags &=3D = ~DS_FLAG_INCONSISTENT; > + dsl_dataset_phys(ds->ds_prev)->ds_guid =3D > + drc->drc_drrb->drr_toguid; > + dsl_dataset_phys(ds->ds_prev)->ds_flags &=3D > + ~DS_FLAG_INCONSISTENT; >=20 > dmu_buf_will_dirty(ds->ds_dbuf, tx); > - ds->ds_phys->ds_flags &=3D ~DS_FLAG_INCONSISTENT; > + dsl_dataset_phys(ds)->ds_flags &=3D = ~DS_FLAG_INCONSISTENT; > } > - drc->drc_newsnapobj =3D drc->drc_ds->ds_phys->ds_prev_snap_obj; > + drc->drc_newsnapobj =3D = dsl_dataset_phys(drc->drc_ds)->ds_prev_snap_obj; > /* > * Release the hold from dmu_recv_begin. This must be done = before > * we return to open context, so that when we free the dataset's = dnode, > @@ -2077,7 +2087,7 @@ add_ds_to_guidmap(const char *name, avl_ > gmep =3D kmem_alloc(sizeof (*gmep), KM_SLEEP); > err =3D dsl_dataset_hold_obj(dp, snapobj, gmep, &snapds); > if (err =3D=3D 0) { > - gmep->guid =3D snapds->ds_phys->ds_guid; > + gmep->guid =3D dsl_dataset_phys(snapds)->ds_guid; > gmep->gme_ds =3D snapds; > avl_add(guid_map, gmep); > dsl_dataset_long_hold(snapds, gmep); >=20 > Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c Sat Dec = 6 00:47:31 2014 (r275550) > +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c Sat Dec = 6 00:50:57 2014 (r275551) > @@ -579,7 +579,7 @@ traverse_dataset(dsl_dataset_t *ds, uint > blkptr_cb_t func, void *arg) > { > return (traverse_impl(ds->ds_dir->dd_pool->dp_spa, ds, = ds->ds_object, > - &ds->ds_phys->ds_bp, txg_start, NULL, flags, func, arg)); > + &dsl_dataset_phys(ds)->ds_bp, txg_start, NULL, flags, func, = arg)); > } >=20 > int > @@ -634,8 +634,8 @@ traverse_pool(spa_t *spa, uint64_t txg_s > continue; > break; > } > - if (ds->ds_phys->ds_prev_snap_txg > txg) > - txg =3D ds->ds_phys->ds_prev_snap_txg; > + if (dsl_dataset_phys(ds)->ds_prev_snap_txg > = txg) > + txg =3D = dsl_dataset_phys(ds)->ds_prev_snap_txg; > err =3D traverse_dataset(ds, txg, flags, func, = arg); > dsl_dataset_rele(ds, FTAG); > if (err !=3D 0) >=20 > Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Sat Dec = 6 00:47:31 2014 (r275550) > +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Sat Dec = 6 00:50:57 2014 (r275551) > @@ -713,6 +713,7 @@ dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t o > { > dmu_tx_hold_t *txh; > dnode_t *dn; > + dsl_dataset_phys_t *ds_phys; > uint64_t nblocks; > int epbs, err; >=20 > @@ -787,8 +788,9 @@ dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t o > * we'll have to modify an indirect twig for each. > */ > epbs =3D dn->dn_indblkshift - SPA_BLKPTRSHIFT; > + ds_phys =3D dsl_dataset_phys(dn->dn_objset->os_dsl_dataset); > for (nblocks =3D dn->dn_maxblkid >> epbs; nblocks !=3D 0; = nblocks >>=3D epbs) > - if = (dn->dn_objset->os_dsl_dataset->ds_phys->ds_prev_snap_obj) > + if (ds_phys->ds_prev_snap_obj) > txh->txh_space_towrite +=3D 3 << = dn->dn_indblkshift; > else > txh->txh_space_tooverwrite +=3D 3 << = dn->dn_indblkshift; >=20 > Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Sat Dec 6 = 00:47:31 2014 (r275550) > +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Sat Dec 6 = 00:50:57 2014 (r275551) > @@ -1116,7 +1116,7 @@ dnode_hold_impl(objset_t *os, uint64_t o > zrl_init(&dnh[i].dnh_zrlock); > dnh[i].dnh_dnode =3D NULL; > } > - if (winner =3D dmu_buf_set_user(&db->db, = children_dnodes, NULL, > + if (winner =3D dmu_buf_set_user(&db->db, = children_dnodes, > dnode_buf_pageout)) { >=20 > for (i =3D 0; i < epb; i++) { >=20 > Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_bookmark.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_bookmark.c Sat Dec = 6 00:47:31 2014 (r275550) > +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_bookmark.c Sat Dec = 6 00:50:57 2014 (r275551) > @@ -65,7 +65,7 @@ dsl_dataset_bmark_lookup(dsl_dataset_t * > if (bmark_zapobj =3D=3D 0) > return (SET_ERROR(ESRCH)); >=20 > - if (ds->ds_phys->ds_flags & DS_FLAG_CI_DATASET) > + if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) > mt =3D MT_FIRST; > else > mt =3D MT_EXACT; > @@ -208,10 +208,11 @@ dsl_bookmark_create_sync(void *arg, dmu_ > &bmark_fs->ds_bookmarks, tx)); > } >=20 > - bmark_phys.zbm_guid =3D snapds->ds_phys->ds_guid; > - bmark_phys.zbm_creation_txg =3D = snapds->ds_phys->ds_creation_txg; > + bmark_phys.zbm_guid =3D = dsl_dataset_phys(snapds)->ds_guid; > + bmark_phys.zbm_creation_txg =3D > + dsl_dataset_phys(snapds)->ds_creation_txg; > bmark_phys.zbm_creation_time =3D > - snapds->ds_phys->ds_creation_time; > + dsl_dataset_phys(snapds)->ds_creation_time; >=20 > VERIFY0(zap_add(mos, bmark_fs->ds_bookmarks, > shortname, sizeof (uint64_t), > @@ -340,7 +341,7 @@ dsl_dataset_bookmark_remove(dsl_dataset_ > uint64_t bmark_zapobj =3D ds->ds_bookmarks; > matchtype_t mt; >=20 > - if (ds->ds_phys->ds_flags & DS_FLAG_CI_DATASET) > + if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) > mt =3D MT_FIRST; > else > mt =3D MT_EXACT; >=20 > Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Sat Dec = 6 00:47:31 2014 (r275550) > +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Sat Dec = 6 00:50:57 2014 (r275551) > @@ -70,6 +70,9 @@ int zfs_max_recordsize =3D 1 * 1024 * 1024 >=20 > #define DS_REF_MAX (1ULL << 62) >=20 > +extern inline dsl_dataset_phys_t *dsl_dataset_phys(dsl_dataset_t = *ds); > +extern inline boolean_t dsl_dataset_is_snapshot(dsl_dataset_t *ds); > + > /* > * Figure out how much of this delta should be propogated to the = dsl_dir > * layer. If there's a refreservation, that space has already been > @@ -78,13 +81,15 @@ int zfs_max_recordsize =3D 1 * 1024 * 1024 > static int64_t > parent_delta(dsl_dataset_t *ds, int64_t delta) > { > + dsl_dataset_phys_t *ds_phys; > uint64_t old_bytes, new_bytes; >=20 > if (ds->ds_reserved =3D=3D 0) > return (delta); >=20 > - old_bytes =3D MAX(ds->ds_phys->ds_unique_bytes, = ds->ds_reserved); > - new_bytes =3D MAX(ds->ds_phys->ds_unique_bytes + delta, = ds->ds_reserved); > + ds_phys =3D dsl_dataset_phys(ds); > + old_bytes =3D MAX(ds_phys->ds_unique_bytes, ds->ds_reserved); > + new_bytes =3D MAX(ds_phys->ds_unique_bytes + delta, = ds->ds_reserved); >=20 > ASSERT3U(ABS((int64_t)(new_bytes - old_bytes)), <=3D, = ABS(delta)); > return (new_bytes - old_bytes); > @@ -115,10 +120,10 @@ dsl_dataset_block_born(dsl_dataset_t *ds > dmu_buf_will_dirty(ds->ds_dbuf, tx); > mutex_enter(&ds->ds_lock); > delta =3D parent_delta(ds, used); > - ds->ds_phys->ds_referenced_bytes +=3D used; > - ds->ds_phys->ds_compressed_bytes +=3D compressed; > - ds->ds_phys->ds_uncompressed_bytes +=3D uncompressed; > - ds->ds_phys->ds_unique_bytes +=3D used; > + dsl_dataset_phys(ds)->ds_referenced_bytes +=3D used; > + dsl_dataset_phys(ds)->ds_compressed_bytes +=3D compressed; > + dsl_dataset_phys(ds)->ds_uncompressed_bytes +=3D uncompressed; > + dsl_dataset_phys(ds)->ds_unique_bytes +=3D used; > if (BP_GET_LSIZE(bp) > SPA_OLD_MAXBLOCKSIZE) > ds->ds_need_large_blocks =3D B_TRUE; > mutex_exit(&ds->ds_lock); > @@ -153,17 +158,17 @@ dsl_dataset_block_kill(dsl_dataset_t *ds > ASSERT(!dsl_dataset_is_snapshot(ds)); > dmu_buf_will_dirty(ds->ds_dbuf, tx); >=20 > - if (bp->blk_birth > ds->ds_phys->ds_prev_snap_txg) { > + if (bp->blk_birth > dsl_dataset_phys(ds)->ds_prev_snap_txg) { > int64_t delta; >=20 > dprintf_bp(bp, "freeing ds=3D%llu", ds->ds_object); > dsl_free(tx->tx_pool, tx->tx_txg, bp); >=20 > mutex_enter(&ds->ds_lock); > - ASSERT(ds->ds_phys->ds_unique_bytes >=3D used || > + ASSERT(dsl_dataset_phys(ds)->ds_unique_bytes >=3D used = || > !DS_UNIQUE_IS_ACCURATE(ds)); > delta =3D parent_delta(ds, -used); > - ds->ds_phys->ds_unique_bytes -=3D used; > + dsl_dataset_phys(ds)->ds_unique_bytes -=3D used; > mutex_exit(&ds->ds_lock); > dsl_dir_diduse_space(ds->ds_dir, DD_USED_HEAD, > delta, -compressed, -uncompressed, tx); > @@ -184,15 +189,15 @@ dsl_dataset_block_kill(dsl_dataset_t *ds > dsl_deadlist_insert(&ds->ds_deadlist, bp, tx); > } > ASSERT3U(ds->ds_prev->ds_object, =3D=3D, > - ds->ds_phys->ds_prev_snap_obj); > - ASSERT(ds->ds_prev->ds_phys->ds_num_children > 0); > + dsl_dataset_phys(ds)->ds_prev_snap_obj); > + ASSERT(dsl_dataset_phys(ds->ds_prev)->ds_num_children > = 0); > /* if (bp->blk_birth > prev prev snap txg) prev unique = +=3D bs */ > - if (ds->ds_prev->ds_phys->ds_next_snap_obj =3D=3D > + if (dsl_dataset_phys(ds->ds_prev)->ds_next_snap_obj =3D=3D= > ds->ds_object && bp->blk_birth > > - ds->ds_prev->ds_phys->ds_prev_snap_txg) { > + dsl_dataset_phys(ds->ds_prev)->ds_prev_snap_txg) { > dmu_buf_will_dirty(ds->ds_prev->ds_dbuf, tx); > mutex_enter(&ds->ds_prev->ds_lock); > - ds->ds_prev->ds_phys->ds_unique_bytes +=3D used; > + dsl_dataset_phys(ds->ds_prev)->ds_unique_bytes = +=3D used; > mutex_exit(&ds->ds_prev->ds_lock); > } > if (bp->blk_birth > ds->ds_dir->dd_origin_txg) { > @@ -201,12 +206,12 @@ dsl_dataset_block_kill(dsl_dataset_t *ds > } > } > mutex_enter(&ds->ds_lock); > - ASSERT3U(ds->ds_phys->ds_referenced_bytes, >=3D, used); > - ds->ds_phys->ds_referenced_bytes -=3D used; > - ASSERT3U(ds->ds_phys->ds_compressed_bytes, >=3D, compressed); > - ds->ds_phys->ds_compressed_bytes -=3D compressed; > - ASSERT3U(ds->ds_phys->ds_uncompressed_bytes, >=3D, = uncompressed); > - ds->ds_phys->ds_uncompressed_bytes -=3D uncompressed; > + ASSERT3U(dsl_dataset_phys(ds)->ds_referenced_bytes, >=3D, used); > + dsl_dataset_phys(ds)->ds_referenced_bytes -=3D used; > + ASSERT3U(dsl_dataset_phys(ds)->ds_compressed_bytes, >=3D, = compressed); > + dsl_dataset_phys(ds)->ds_compressed_bytes -=3D compressed; > + ASSERT3U(dsl_dataset_phys(ds)->ds_uncompressed_bytes, >=3D, = uncompressed); > + dsl_dataset_phys(ds)->ds_uncompressed_bytes -=3D uncompressed; > mutex_exit(&ds->ds_lock); >=20 > return (used); > @@ -232,7 +237,7 @@ dsl_dataset_prev_snap_txg(dsl_dataset_t=20 > if (ds->ds_trysnap_txg > > spa_last_synced_txg(ds->ds_dir->dd_pool->dp_spa)) > trysnap =3D ds->ds_trysnap_txg; > - return (MAX(ds->ds_phys->ds_prev_snap_txg, trysnap)); > + return (MAX(dsl_dataset_phys(ds)->ds_prev_snap_txg, trysnap)); > } >=20 > boolean_t > @@ -267,7 +272,7 @@ dsl_dataset_evict(dmu_buf_t *db, void *d > } >=20 > bplist_destroy(&ds->ds_pending_deadlist); > - if (ds->ds_phys->ds_deadlist_obj !=3D 0) > + if (dsl_dataset_phys(ds)->ds_deadlist_obj !=3D 0) > dsl_deadlist_close(&ds->ds_deadlist); > if (ds->ds_dir) > dsl_dir_rele(ds->ds_dir, ds); > @@ -293,10 +298,10 @@ dsl_dataset_get_snapname(dsl_dataset_t * >=20 > if (ds->ds_snapname[0]) > return (0); > - if (ds->ds_phys->ds_next_snap_obj =3D=3D 0) > + if (dsl_dataset_phys(ds)->ds_next_snap_obj =3D=3D 0) > return (0); >=20 > - err =3D dmu_bonus_hold(mos, = ds->ds_dir->dd_phys->dd_head_dataset_obj, > + err =3D dmu_bonus_hold(mos, = dsl_dir_phys(ds->ds_dir)->dd_head_dataset_obj, > FTAG, &headdbuf); > if (err !=3D 0) > return (err); > @@ -311,11 +316,11 @@ int > dsl_dataset_snap_lookup(dsl_dataset_t *ds, const char *name, uint64_t = *value) > { > objset_t *mos =3D ds->ds_dir->dd_pool->dp_meta_objset; > - uint64_t snapobj =3D ds->ds_phys->ds_snapnames_zapobj; > + uint64_t snapobj =3D dsl_dataset_phys(ds)->ds_snapnames_zapobj; > matchtype_t mt; > int err; >=20 > - if (ds->ds_phys->ds_flags & DS_FLAG_CI_DATASET) > + if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) > mt =3D MT_FIRST; > else > mt =3D MT_EXACT; > @@ -332,13 +337,13 @@ dsl_dataset_snap_remove(dsl_dataset_t *d > boolean_t adj_cnt) > { > objset_t *mos =3D ds->ds_dir->dd_pool->dp_meta_objset; > - uint64_t snapobj =3D ds->ds_phys->ds_snapnames_zapobj; > + uint64_t snapobj =3D dsl_dataset_phys(ds)->ds_snapnames_zapobj; > matchtype_t mt; > int err; >=20 > dsl_dir_snap_cmtime_update(ds->ds_dir); >=20 > - if (ds->ds_phys->ds_flags & DS_FLAG_CI_DATASET) > + if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) > mt =3D MT_FIRST; > else > mt =3D MT_EXACT; > @@ -384,7 +389,6 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin > ds =3D kmem_zalloc(sizeof (dsl_dataset_t), KM_SLEEP); > ds->ds_dbuf =3D dbuf; > ds->ds_object =3D dsobj; > - ds->ds_phys =3D dbuf->db_data; >=20 > mutex_init(&ds->ds_lock, NULL, MUTEX_DEFAULT, NULL); > mutex_init(&ds->ds_opening_lock, NULL, MUTEX_DEFAULT, = NULL); > @@ -393,7 +397,7 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin >=20 > bplist_create(&ds->ds_pending_deadlist); > dsl_deadlist_open(&ds->ds_deadlist, > - mos, ds->ds_phys->ds_deadlist_obj); > + mos, dsl_dataset_phys(ds)->ds_deadlist_obj); >=20 > list_create(&ds->ds_sendstreams, sizeof (dmu_sendarg_t), > offsetof(dmu_sendarg_t, dsa_link)); > @@ -408,7 +412,8 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin >=20 > if (err =3D=3D 0) { > err =3D dsl_dir_hold_obj(dp, > - ds->ds_phys->ds_dir_obj, NULL, ds, = &ds->ds_dir); > + dsl_dataset_phys(ds)->ds_dir_obj, NULL, ds, > + &ds->ds_dir); > } > if (err !=3D 0) { > mutex_destroy(&ds->ds_lock); > @@ -424,9 +429,9 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin >=20 > if (!dsl_dataset_is_snapshot(ds)) { > ds->ds_snapname[0] =3D '\0'; > - if (ds->ds_phys->ds_prev_snap_obj !=3D 0) { > + if (dsl_dataset_phys(ds)->ds_prev_snap_obj !=3D = 0) { > err =3D dsl_dataset_hold_obj(dp, > - ds->ds_phys->ds_prev_snap_obj, > + = dsl_dataset_phys(ds)->ds_prev_snap_obj, > ds, &ds->ds_prev); > } > if (doi.doi_type =3D=3D DMU_OTN_ZAP_METADATA) { > @@ -440,10 +445,11 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin > } else { > if (zfs_flags & ZFS_DEBUG_SNAPNAMES) > err =3D dsl_dataset_get_snapname(ds); > - if (err =3D=3D 0 && ds->ds_phys->ds_userrefs_obj = !=3D 0) { > + if (err =3D=3D 0 && > + dsl_dataset_phys(ds)->ds_userrefs_obj !=3D = 0) { > err =3D zap_count( > ds->ds_dir->dd_pool->dp_meta_objset, > - ds->ds_phys->ds_userrefs_obj, > + = dsl_dataset_phys(ds)->ds_userrefs_obj, > &ds->ds_userrefs); > } > } > @@ -462,7 +468,7 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin > } >=20 > if (err !=3D 0 || (winner =3D dmu_buf_set_user_ie(dbuf, = ds, > - &ds->ds_phys, dsl_dataset_evict)) !=3D NULL) { > + dsl_dataset_evict)) !=3D NULL) { > bplist_destroy(&ds->ds_pending_deadlist); > dsl_deadlist_close(&ds->ds_deadlist); > if (ds->ds_prev) > @@ -480,12 +486,12 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin > ds =3D winner; > } else { > ds->ds_fsid_guid =3D > - unique_insert(ds->ds_phys->ds_fsid_guid); > + = unique_insert(dsl_dataset_phys(ds)->ds_fsid_guid); > } > } > ASSERT3P(ds->ds_dbuf, =3D=3D, dbuf); > - ASSERT3P(ds->ds_phys, =3D=3D, dbuf->db_data); > - ASSERT(ds->ds_phys->ds_prev_snap_obj !=3D 0 || > + ASSERT3P(dsl_dataset_phys(ds), =3D=3D, dbuf->db_data); > + ASSERT(dsl_dataset_phys(ds)->ds_prev_snap_obj !=3D 0 || > spa_version(dp->dp_spa) < SPA_VERSION_ORIGIN || > dp->dp_origin_snap =3D=3D NULL || ds =3D=3D = dp->dp_origin_snap); > *dsp =3D ds; > @@ -506,7 +512,7 @@ dsl_dataset_hold(dsl_pool_t *dp, const c > return (err); >=20 > ASSERT(dsl_pool_config_held(dp)); > - obj =3D dd->dd_phys->dd_head_dataset_obj; > + obj =3D dsl_dir_phys(dd)->dd_head_dataset_obj; > if (obj !=3D 0) > err =3D dsl_dataset_hold_obj(dp, obj, tag, dsp); > else > @@ -673,9 +679,9 @@ dsl_dataset_create_sync_dd(dsl_dir_t *dd > origin =3D dp->dp_origin_snap; >=20 > ASSERT(origin =3D=3D NULL || origin->ds_dir->dd_pool =3D=3D dp); > - ASSERT(origin =3D=3D NULL || origin->ds_phys->ds_num_children > = 0); > + ASSERT(origin =3D=3D NULL || = dsl_dataset_phys(origin)->ds_num_children > 0); > ASSERT(dmu_tx_is_syncing(tx)); > - ASSERT(dd->dd_phys->dd_head_dataset_obj =3D=3D 0); > + ASSERT(dsl_dir_phys(dd)->dd_head_dataset_obj =3D=3D 0); >=20 > dsobj =3D dmu_object_alloc(mos, DMU_OT_DSL_DATASET, 0, > DMU_OT_DSL_DATASET, sizeof (dsl_dataset_phys_t), tx); > @@ -701,55 +707,58 @@ dsl_dataset_create_sync_dd(dsl_dir_t *dd >=20 > dsphys->ds_prev_snap_obj =3D origin->ds_object; > dsphys->ds_prev_snap_txg =3D > - origin->ds_phys->ds_creation_txg; > + dsl_dataset_phys(origin)->ds_creation_txg; > dsphys->ds_referenced_bytes =3D > - origin->ds_phys->ds_referenced_bytes; > + dsl_dataset_phys(origin)->ds_referenced_bytes; > dsphys->ds_compressed_bytes =3D > - origin->ds_phys->ds_compressed_bytes; > + dsl_dataset_phys(origin)->ds_compressed_bytes; > dsphys->ds_uncompressed_bytes =3D > - origin->ds_phys->ds_uncompressed_bytes; > - dsphys->ds_bp =3D origin->ds_phys->ds_bp; > + dsl_dataset_phys(origin)->ds_uncompressed_bytes; > + dsphys->ds_bp =3D dsl_dataset_phys(origin)->ds_bp; >=20 > /* > * Inherit flags that describe the dataset's contents > * (INCONSISTENT) or properties (Case Insensitive). > */ > - dsphys->ds_flags |=3D origin->ds_phys->ds_flags & > + dsphys->ds_flags |=3D dsl_dataset_phys(origin)->ds_flags = & > (DS_FLAG_INCONSISTENT | DS_FLAG_CI_DATASET); >=20 > if (origin->ds_large_blocks) > = dsl_dataset_activate_large_blocks_sync_impl(dsobj, tx); >=20 > dmu_buf_will_dirty(origin->ds_dbuf, tx); > - origin->ds_phys->ds_num_children++; > + dsl_dataset_phys(origin)->ds_num_children++; >=20 > VERIFY0(dsl_dataset_hold_obj(dp, > - origin->ds_dir->dd_phys->dd_head_dataset_obj, FTAG, = &ohds)); > + dsl_dir_phys(origin->ds_dir)->dd_head_dataset_obj, > + FTAG, &ohds)); > dsphys->ds_deadlist_obj =3D = dsl_deadlist_clone(&ohds->ds_deadlist, > dsphys->ds_prev_snap_txg, dsphys->ds_prev_snap_obj, = tx); > dsl_dataset_rele(ohds, FTAG); >=20 > if (spa_version(dp->dp_spa) >=3D = SPA_VERSION_NEXT_CLONES) { > - if (origin->ds_phys->ds_next_clones_obj =3D=3D = 0) { > - origin->ds_phys->ds_next_clones_obj =3D > + if (dsl_dataset_phys(origin)->ds_next_clones_obj = =3D=3D 0) { > + = dsl_dataset_phys(origin)->ds_next_clones_obj =3D > zap_create(mos, > DMU_OT_NEXT_CLONES, DMU_OT_NONE, 0, = tx); > } > VERIFY0(zap_add_int(mos, > - origin->ds_phys->ds_next_clones_obj, dsobj, = tx)); > + = dsl_dataset_phys(origin)->ds_next_clones_obj, > + dsobj, tx)); > } >=20 > dmu_buf_will_dirty(dd->dd_dbuf, tx); > - dd->dd_phys->dd_origin_obj =3D origin->ds_object; > + dsl_dir_phys(dd)->dd_origin_obj =3D origin->ds_object; > if (spa_version(dp->dp_spa) >=3D SPA_VERSION_DIR_CLONES) = { > - if (origin->ds_dir->dd_phys->dd_clones =3D=3D 0) = { > + if (dsl_dir_phys(origin->ds_dir)->dd_clones =3D=3D= 0) { > = dmu_buf_will_dirty(origin->ds_dir->dd_dbuf, tx); > - origin->ds_dir->dd_phys->dd_clones =3D > + dsl_dir_phys(origin->ds_dir)->dd_clones = =3D > zap_create(mos, > DMU_OT_DSL_CLONES, DMU_OT_NONE, 0, = tx); > } > VERIFY0(zap_add_int(mos, > - origin->ds_dir->dd_phys->dd_clones, dsobj, = tx)); > + dsl_dir_phys(origin->ds_dir)->dd_clones, > + dsobj, tx)); > } > } >=20 > @@ -759,7 +768,7 @@ dsl_dataset_create_sync_dd(dsl_dir_t *dd > dmu_buf_rele(dbuf, FTAG); >=20 > dmu_buf_will_dirty(dd->dd_dbuf, tx); > - dd->dd_phys->dd_head_dataset_obj =3D dsobj; > + dsl_dir_phys(dd)->dd_head_dataset_obj =3D dsobj; >=20 > return (dsobj); > } > @@ -841,20 +850,20 @@ dsl_dataset_recalc_head_uniq(dsl_dataset >=20 > ASSERT(!dsl_dataset_is_snapshot(ds)); >=20 > - if (ds->ds_phys->ds_prev_snap_obj !=3D 0) > - mrs_used =3D ds->ds_prev->ds_phys->ds_referenced_bytes; > + if (dsl_dataset_phys(ds)->ds_prev_snap_obj !=3D 0) > + mrs_used =3D = dsl_dataset_phys(ds->ds_prev)->ds_referenced_bytes; > else > mrs_used =3D 0; >=20 > dsl_deadlist_space(&ds->ds_deadlist, &dlused, &dlcomp, = &dluncomp); >=20 > ASSERT3U(dlused, <=3D, mrs_used); > - ds->ds_phys->ds_unique_bytes =3D > - ds->ds_phys->ds_referenced_bytes - (mrs_used - dlused); > + dsl_dataset_phys(ds)->ds_unique_bytes =3D > + dsl_dataset_phys(ds)->ds_referenced_bytes - (mrs_used - = dlused); >=20 > if (spa_version(ds->ds_dir->dd_pool->dp_spa) >=3D > SPA_VERSION_UNIQUE_ACCURATE) > - ds->ds_phys->ds_flags |=3D DS_FLAG_UNIQUE_ACCURATE; > + dsl_dataset_phys(ds)->ds_flags |=3D = DS_FLAG_UNIQUE_ACCURATE; > } >=20 > void > @@ -865,8 +874,9 @@ dsl_dataset_remove_from_next_clones(dsl_ > uint64_t count; > int err; >=20 > - ASSERT(ds->ds_phys->ds_num_children >=3D 2); > - err =3D zap_remove_int(mos, ds->ds_phys->ds_next_clones_obj, = obj, tx); > + ASSERT(dsl_dataset_phys(ds)->ds_num_children >=3D 2); > + err =3D zap_remove_int(mos, = dsl_dataset_phys(ds)->ds_next_clones_obj, > + obj, tx); > /* > * The err should not be ENOENT, but a bug in a previous version > * of the code could cause upgrade_clones_cb() to not set > @@ -879,16 +889,16 @@ dsl_dataset_remove_from_next_clones(dsl_ > */ > if (err !=3D ENOENT) > VERIFY0(err); > - ASSERT0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, > + ASSERT0(zap_count(mos, dsl_dataset_phys(ds)->ds_next_clones_obj, > &count)); > - ASSERT3U(count, <=3D, ds->ds_phys->ds_num_children - 2); > + ASSERT3U(count, <=3D, dsl_dataset_phys(ds)->ds_num_children - = 2); > } >=20 >=20 > blkptr_t * > dsl_dataset_get_blkptr(dsl_dataset_t *ds) > { > - return (&ds->ds_phys->ds_bp); > + return (&dsl_dataset_phys(ds)->ds_bp); > } >=20 > void > @@ -900,7 +910,7 @@ dsl_dataset_set_blkptr(dsl_dataset_t *ds > tx->tx_pool->dp_meta_rootbp =3D *bp; > } else { > dmu_buf_will_dirty(ds->ds_dbuf, tx); > - ds->ds_phys->ds_bp =3D *bp; > + dsl_dataset_phys(ds)->ds_bp =3D *bp; > } > } >=20 > @@ -920,7 +930,7 @@ dsl_dataset_dirty(dsl_dataset_t *ds, dmu >=20 > ASSERT(ds->ds_objset !=3D NULL); >=20 > - if (ds->ds_phys->ds_next_snap_obj !=3D 0) > + if (dsl_dataset_phys(ds)->ds_next_snap_obj !=3D 0) > panic("dirtying snapshot!"); >=20 > dp =3D ds->ds_dir->dd_pool; > @@ -956,7 +966,7 @@ dsl_dataset_snapshot_reserve_space(dsl_d > * outside of the reservation. > */ > ASSERT(ds->ds_reserved =3D=3D 0 || DS_UNIQUE_IS_ACCURATE(ds)); > - asize =3D MIN(ds->ds_phys->ds_unique_bytes, ds->ds_reserved); > + asize =3D MIN(dsl_dataset_phys(ds)->ds_unique_bytes, = ds->ds_reserved); > if (asize > dsl_dir_space_available(ds->ds_dir, NULL, 0, TRUE)) > return (SET_ERROR(ENOSPC)); >=20 > @@ -993,7 +1003,7 @@ dsl_dataset_snapshot_check_impl(dsl_data > * We don't allow multiple snapshots of the same txg. If there > * is already one, try again. > */ > - if (ds->ds_phys->ds_prev_snap_txg >=3D tx->tx_txg) > + if (dsl_dataset_phys(ds)->ds_prev_snap_txg >=3D tx->tx_txg) > return (SET_ERROR(EAGAIN)); >=20 > /* > @@ -1219,35 +1229,38 @@ dsl_dataset_snapshot_sync_impl(dsl_datas > dsphys->ds_fsid_guid =3D unique_create(); > (void) random_get_pseudo_bytes((void*)&dsphys->ds_guid, > sizeof (dsphys->ds_guid)); > - dsphys->ds_prev_snap_obj =3D ds->ds_phys->ds_prev_snap_obj; >=20 > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >=20 >=20
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E38DF16A-2834-4E80-BBCF-703B327EDC88>