Clean up by-dnode code in dmu_tx.c

https://github.com/zfsonlinux/zfs/commit/0eef1bde31d67091d3deed23fe2394f5a8bf2276
introduced some changes which we slightly improved the style of when
porting to illumos.

There is also one minor error-handling fix, in zap_add() the "zap" may
become NULL in case of an error re-opening the ZAP.

Originally suggested at: https://github.com/openzfs/openzfs/pull/276

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #5805
This commit is contained in:
Matthew Ahrens
2017-02-24 13:34:26 -08:00
committed by Brian Behlendorf
parent f7e76821c5
commit 66eead53c9
4 changed files with 31 additions and 36 deletions
+2 -2
View File
@@ -131,7 +131,7 @@ dmu_object_alloc_dnsize(objset_t *os, dmu_object_type_t ot, int blocksize,
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);
@@ -168,7 +168,7 @@ dmu_object_claim_dnsize(objset_t *os, uint64_t object, dmu_object_type_t ot,
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);