From e895c76194acc13ddcf608786347f769fd931dcb Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Mon, 10 Nov 2025 17:26:15 -0500 Subject: [PATCH] ZAP: Remove dmu_object_info_from_dnode() call dmu_object_info_from_dnode() takes two locks and copies plenty of data that we don't need in zap_lockdir_impl(). Just read dn_type directly in this hot path. Reviewed-by: Brian Behlendorf Signed-off-by: Alexander Motin Closes #17921 --- module/zfs/zap_micro.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/module/zfs/zap_micro.c b/module/zfs/zap_micro.c index ea4e3117a..7e9e625a1 100644 --- a/module/zfs/zap_micro.c +++ b/module/zfs/zap_micro.c @@ -625,12 +625,10 @@ zap_lockdir_impl(dnode_t *dn, dmu_buf_t *db, const void *tag, dmu_tx_t *tx, ASSERT0(db->db_offset); objset_t *os = dmu_buf_get_objset(db); uint64_t obj = db->db_object; - dmu_object_info_t doi; *zapp = NULL; - dmu_object_info_from_dnode(dn, &doi); - if (DMU_OT_BYTESWAP(doi.doi_type) != DMU_BSWAP_ZAP) + if (DMU_OT_BYTESWAP(dn->dn_type) != DMU_BSWAP_ZAP) return (SET_ERROR(EINVAL)); zap_t *zap = dmu_buf_get_user(db);