dnode_allocate(dn, ot, blocksize, 0, bonustype, bonuslen, dn_slots, tx);
mutex_exit(&os->os_obj_lock);
- dmu_tx_add_new_object(tx, os, dn);
+ dmu_tx_add_new_object(tx, dn);
dnode_rele(dn, FTAG);
return (object);
return (err);
dnode_allocate(dn, ot, blocksize, 0, bonustype, bonuslen, dn_slots, tx);
- dmu_tx_add_new_object(tx, os, dn);
+ dmu_tx_add_new_object(tx, dn);
dnode_rele(dn, FTAG);
dmu_tx_hold_t *txh;
if (dn != NULL) {
- refcount_add(&dn->dn_holds, tx);
+ (void) refcount_add(&dn->dn_holds, tx);
if (tx->tx_txg != 0) {
mutex_enter(&dn->dn_mtx);
/*
if (object != DMU_NEW_OBJECT) {
err = dnode_hold(os, object, FTAG, &dn);
- if (err) {
+ if (err != 0) {
tx->tx_err = err;
return (NULL);
}
}
void
-dmu_tx_add_new_object(dmu_tx_t *tx, objset_t *os, dnode_t *dn)
+dmu_tx_add_new_object(dmu_tx_t *tx, dnode_t *dn)
{
/*
* If we're syncing, they can manipulate any object anyhow, and
{
dmu_tx_hold_t *txh;
- ASSERT(tx->tx_txg == 0);
- ASSERT(len <= DMU_MAX_ACCESS);
+ ASSERT0(tx->tx_txg);
+ ASSERT3U(len, <=, DMU_MAX_ACCESS);
ASSERT(len == 0 || UINT64_MAX - off >= len - 1);
txh = dmu_tx_hold_object_impl(tx, tx->tx_objset,
object, THT_WRITE, off, len);
- if (txh == NULL)
- return;
-
- dmu_tx_count_write(txh, off, len);
- dmu_tx_count_dnode(txh);
+ if (txh != NULL) {
+ dmu_tx_count_write(txh, off, len);
+ dmu_tx_count_dnode(txh);
+ }
}
void
{
dmu_tx_hold_t *txh;
- ASSERT(tx->tx_txg == 0);
- ASSERT(len <= DMU_MAX_ACCESS);
+ ASSERT0(tx->tx_txg);
+ ASSERT3U(len, <=, DMU_MAX_ACCESS);
ASSERT(len == 0 || UINT64_MAX - off >= len - 1);
txh = dmu_tx_hold_dnode_impl(tx, dn, THT_WRITE, off, len);
- if (txh == NULL)
- return;
-
- dmu_tx_count_write(txh, off, len);
- dmu_tx_count_dnode(txh);
+ if (txh != NULL) {
+ dmu_tx_count_write(txh, off, len);
+ dmu_tx_count_dnode(txh);
+ }
}
static void
txh = dmu_tx_hold_object_impl(tx, tx->tx_objset,
object, THT_FREE, off, len);
- if (txh == NULL)
- return;
- (void) dmu_tx_hold_free_impl(txh, off, len);
+ if (txh != NULL)
+ (void) dmu_tx_hold_free_impl(txh, off, len);
}
void
dmu_tx_hold_t *txh;
txh = dmu_tx_hold_dnode_impl(tx, dn, THT_FREE, off, len);
- if (txh == NULL)
- return;
- (void) dmu_tx_hold_free_impl(txh, off, len);
+ if (txh != NULL)
+ (void) dmu_tx_hold_free_impl(txh, off, len);
}
static void
{
dmu_tx_hold_t *txh;
- ASSERT(tx->tx_txg == 0);
+ ASSERT0(tx->tx_txg);
txh = dmu_tx_hold_object_impl(tx, tx->tx_objset,
object, THT_ZAP, add, (uintptr_t)name);
- if (txh == NULL)
- return;
- dmu_tx_hold_zap_impl(txh, add, name);
+ if (txh != NULL)
+ dmu_tx_hold_zap_impl(txh, add, name);
}
void
{
dmu_tx_hold_t *txh;
- ASSERT(tx->tx_txg == 0);
+ ASSERT0(tx->tx_txg);
ASSERT(dn != NULL);
txh = dmu_tx_hold_dnode_impl(tx, dn, THT_ZAP, add, (uintptr_t)name);
- if (txh == NULL)
- return;
- dmu_tx_hold_zap_impl(txh, add, name);
+ if (txh != NULL)
+ dmu_tx_hold_zap_impl(txh, add, name);
}
void
{
dmu_tx_hold_t *txh;
- ASSERT(tx->tx_txg == 0);
+ ASSERT0(tx->tx_txg);
txh = dmu_tx_hold_dnode_impl(tx, dn, THT_BONUS, 0, 0);
if (txh)