aboutsummaryrefslogtreecommitdiffstats
path: root/uts/common/fs/zfs/dmu_object.c
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2017-04-14 18:25:02 +0000
committerAndriy Gapon <avg@FreeBSD.org>2017-04-14 18:25:02 +0000
commitfd870ba29a04f8a62ef9ae8f3e6b06a8b2ba8006 (patch)
tree338a9737d1fcfec672399d1f35d748bdbc0f8c7a /uts/common/fs/zfs/dmu_object.c
parentc9327351e8b6e2837d700c7c08a52146112fc04e (diff)
downloadsrc-fd870ba29a04f8a62ef9ae8f3e6b06a8b2ba8006.tar.gz
src-fd870ba29a04f8a62ef9ae8f3e6b06a8b2ba8006.zip
7801 add more by-dnode routines
illumos/illumos-gate@b0c42cd4706ba01ce158bd2bb1004f7e59eca5fe https://github.com/illumos/illumos-gate/commit/b0c42cd4706ba01ce158bd2bb1004f7e59eca5fe https://www.illumos.org/issues/7801 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. Ported from: https://github.com/zfsonlinux/zfs/commit/ 0eef1bde31d67091d3deed23fe2394f5a8bf2276 Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: bzzz77 <bzzz.tomas@gmail.com>
Notes
Notes: svn path=/vendor-sys/illumos/dist/; revision=316914
Diffstat (limited to 'uts/common/fs/zfs/dmu_object.c')
-rw-r--r--uts/common/fs/zfs/dmu_object.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/uts/common/fs/zfs/dmu_object.c b/uts/common/fs/zfs/dmu_object.c
index 3e4171ce6cc6..40898ef26d97 100644
--- a/uts/common/fs/zfs/dmu_object.c
+++ b/uts/common/fs/zfs/dmu_object.c
@@ -93,11 +93,11 @@ dmu_object_alloc(objset_t *os, dmu_object_type_t ot, int blocksize,
}
dnode_allocate(dn, ot, blocksize, 0, bonustype, bonuslen, 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, dn);
+ dnode_rele(dn, FTAG);
+
return (object);
}
@@ -115,9 +115,10 @@ dmu_object_claim(objset_t *os, uint64_t object, dmu_object_type_t ot,
if (err)
return (err);
dnode_allocate(dn, ot, blocksize, 0, bonustype, bonuslen, tx);
+ dmu_tx_add_new_object(tx, dn);
+
dnode_rele(dn, FTAG);
- dmu_tx_add_new_object(tx, os, object);
return (0);
}