Simplify dnode_level_is_l2cacheable()

We should not dereference through dn_handle->dnh_dnode once we
already have a dnode pointer.  The result will be the same.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com>
Closes #18212
This commit is contained in:
Alexander Motin 2026-02-16 10:34:22 -05:00 committed by GitHub
parent ba970eb202
commit 0f9564e85b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -671,8 +671,7 @@ dnode_level_is_l2cacheable(blkptr_t *bp, dnode_t *dn, int64_t level)
{
if (dn->dn_objset->os_secondary_cache == ZFS_CACHE_ALL ||
(dn->dn_objset->os_secondary_cache == ZFS_CACHE_METADATA &&
(level > 0 ||
DMU_OT_IS_METADATA(dn->dn_handle->dnh_dnode->dn_type)))) {
(level > 0 || DMU_OT_IS_METADATA(dn->dn_type)))) {
if (l2arc_exclude_special == 0)
return (B_TRUE);