Cleanup DB_DNODE() macros usage

- Use the macros in few places it was missed.
 - Reduce scope of DB_DNODE_ENTER/EXIT() and inline some DB_DNODE()
uses to make it more obvious what exactly is protected there and
make unprotected accesses by mistake more difficult.
 - Make use of zrl_owner().

Reviewed-by: Rob Wing <rob.wing@klarasystems.com
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #16374
This commit is contained in:
Alexander Motin
2024-07-21 21:04:38 -04:00
committed by Brian Behlendorf
parent 62e7d3c89e
commit 1a3e32e6a2
6 changed files with 34 additions and 51 deletions
+1 -1
View File
@@ -1757,7 +1757,7 @@ dnode_rele_and_unlock(dnode_t *dn, const void *tag, boolean_t evicting)
* handle.
*/
#ifdef ZFS_DEBUG
ASSERT(refs > 0 || dnh->dnh_zrlock.zr_owner != curthread);
ASSERT(refs > 0 || zrl_owner(&dnh->dnh_zrlock) != curthread);
#endif
/* NOTE: the DNODE_DNODE does not have a dn_dbuf */