summaryrefslogtreecommitdiffstats
path: root/module/zfs/dmu_recv.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2019-01-10 14:37:43 -0800
committerGitHub <[email protected]>2019-01-10 14:37:43 -0800
commit6955b40138b959af724a332df32ae64c872d876b (patch)
tree14a0e26473d758f2533e2a1c4c81f4ac9e167a86 /module/zfs/dmu_recv.c
parent58769a4ebd462461131f19cccf25c3d19a4dbfb5 (diff)
Provide more flexible object allocation interface
Object allocation performance can be improved for complex operations by providing an interface which returns the newly allocated dnode. This allows the caller to immediately use the dnode without incurring the expense of looking up the dnode by object number. The functions dmu_object_alloc_hold(), zap_create_hold(), and dmu_bonus_hold_by_dnode() were added for this purpose. The zap_create_* functions have been updated to take advantage of this new functionality. The dmu_bonus_hold_impl() function should really have never been included in sys/dmu.h and was removed. It's sole caller was converted to use dmu_bonus_hold_by_dnode(). The new symbols have been exported for use by Lustre. Reviewed-by: Tony Hutter <[email protected]> Reviewed by: Matt Ahrens <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #8015
Diffstat (limited to 'module/zfs/dmu_recv.c')
-rw-r--r--module/zfs/dmu_recv.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/module/zfs/dmu_recv.c b/module/zfs/dmu_recv.c
index 990f79025..a448bc148 100644
--- a/module/zfs/dmu_recv.c
+++ b/module/zfs/dmu_recv.c
@@ -1323,13 +1323,15 @@ receive_object(struct receive_writer_arg *rwa, struct drr_object *drro,
if (data != NULL) {
dmu_buf_t *db;
+ dnode_t *dn;
uint32_t flags = DMU_READ_NO_PREFETCH;
if (rwa->raw)
flags |= DMU_READ_NO_DECRYPT;
- VERIFY0(dmu_bonus_hold_impl(rwa->os, drro->drr_object,
- FTAG, flags, &db));
+ VERIFY0(dnode_hold(rwa->os, drro->drr_object, FTAG, &dn));
+ VERIFY0(dmu_bonus_hold_by_dnode(dn, FTAG, &db, flags));
+
dmu_buf_will_dirty(db, tx);
ASSERT3U(db->db_size, >=, drro->drr_bonuslen);
@@ -1346,6 +1348,7 @@ receive_object(struct receive_writer_arg *rwa, struct drr_object *drro,
DRR_OBJECT_PAYLOAD_SIZE(drro));
}
dmu_buf_rele(db, FTAG);
+ dnode_rele(dn, FTAG);
}
dmu_tx_commit(tx);