object = sa_handle_object(hdl);
- dmu_tx_hold_bonus(tx, object);
+ dmu_buf_impl_t *db = (dmu_buf_impl_t *)hdl->sa_bonus;
+ DB_DNODE_ENTER(db);
+ dmu_tx_hold_bonus_by_dnode(tx, DB_DNODE(db));
+ DB_DNODE_EXIT(db);
if (tx->tx_objset->os_sa->sa_master_obj == 0)
return;
ASSERT(tx->tx_txg == 0);
dmu_tx_hold_spill(tx, object);
} else {
- dmu_buf_impl_t *db = (dmu_buf_impl_t *)hdl->sa_bonus;
dnode_t *dn;
DB_DNODE_ENTER(db);
dmu_buf_rele(hdl->sa_bonus, NULL);
if (hdl->sa_spill)
- dmu_buf_rele((dmu_buf_t *)hdl->sa_spill, NULL);
+ dmu_buf_rele(hdl->sa_spill, NULL);
mutex_exit(&hdl->sa_lock);
kmem_cache_free(sa_cache, hdl);
hdl->sa_spill_tab = NULL;
}
- dmu_buf_rele((dmu_buf_t *)hdl->sa_spill, NULL);
+ dmu_buf_rele(hdl->sa_spill, NULL);
hdl->sa_spill = NULL;
}
void
sa_object_info(sa_handle_t *hdl, dmu_object_info_t *doi)
{
- dmu_object_info_from_db((dmu_buf_t *)hdl->sa_bonus, doi);
+ dmu_object_info_from_db(hdl->sa_bonus, doi);
}
void
sa_object_size(sa_handle_t *hdl, uint32_t *blksize, u_longlong_t *nblocks)
{
- dmu_object_size_from_db((dmu_buf_t *)hdl->sa_bonus,
+ dmu_object_size_from_db(hdl->sa_bonus,
blksize, nblocks);
}
dmu_buf_t *
sa_get_db(sa_handle_t *hdl)
{
- return ((dmu_buf_t *)hdl->sa_bonus);
+ return (hdl->sa_bonus);
}
void *
*/
dmu_tx_t *tx = dmu_tx_create(zfsvfs->z_os);
dmu_tx_hold_sa(tx, zp->z_sa_hdl, B_FALSE);
- dmu_tx_hold_write(tx, zp->z_id, woff, MIN(n, max_blksz));
+ dmu_buf_impl_t *db = (dmu_buf_impl_t *)sa_get_db(zp->z_sa_hdl);
+ DB_DNODE_ENTER(db);
+ dmu_tx_hold_write_by_dnode(tx, DB_DNODE(db), woff,
+ MIN(n, max_blksz));
+ DB_DNODE_EXIT(db);
zfs_sa_upgrade_txholds(tx, zp);
error = dmu_tx_assign(tx, TXG_WAIT);
if (error) {
return (SET_ERROR(ENOENT));
}
- zgd = (zgd_t *)kmem_zalloc(sizeof (zgd_t), KM_SLEEP);
+ zgd = kmem_zalloc(sizeof (zgd_t), KM_SLEEP);
zgd->zgd_lwb = lwb;
zgd->zgd_private = zp;