diff options
author | bzzz77 <[email protected]> | 2017-01-14 01:58:41 +0300 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-01-13 14:58:41 -0800 |
commit | 0eef1bde31d67091d3deed23fe2394f5a8bf2276 (patch) | |
tree | f16df818c69345a235c436a2e6d565d53657bf46 /module/zfs/dmu_object.c | |
parent | 38640550f28c5acd94621f3452fab428df469bdb (diff) |
Add *_by-dnode routines
Add *_by_dnode() routines for accessing objects given their
dnode_t *, this is more efficient than accessing the object by
(objset_t *, uint64_t object). This change converts some but
not all of the existing consumers. As performance-sensitive
code paths are discovered they should be converted to use
these routines.
Reviewed-by: Matthew Ahrens <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Alex Zhuravlev <[email protected]>
Closes #5534
Issue #4802
Diffstat (limited to 'module/zfs/dmu_object.c')
-rw-r--r-- | module/zfs/dmu_object.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/module/zfs/dmu_object.c b/module/zfs/dmu_object.c index e54043fc3..488ca2155 100644 --- a/module/zfs/dmu_object.c +++ b/module/zfs/dmu_object.c @@ -129,11 +129,11 @@ 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); - dnode_rele(dn, FTAG); - mutex_exit(&os->os_obj_lock); - dmu_tx_add_new_object(tx, os, object); + dmu_tx_add_new_object(tx, os, dn); + dnode_rele(dn, FTAG); + return (object); } @@ -168,9 +168,10 @@ 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); + dnode_rele(dn, FTAG); - dmu_tx_add_new_object(tx, os, object); return (0); } |