FreeBSD: Use new SYSCTL_SIZEOF()

SYSCTL_SIZEOF() has been introduced in FreeBSD by commit "sysctl(9):
Ease exporting struct sizes; Discourage doing that" (713abc9880aa) in
branch 'main'.  It will soon be backported to 'stable/14'.  We will thus
be able to remove the old, alternate version left in the '#else' branch
as soon as 'stable/13' goes out of support (April 30, 2026).

Sponsored-by:   The FreeBSD Foundation
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Olivier Certner <olce@FreeBSD.org>
Closes #17309
This commit is contained in:
Olivier Certner 2025-05-08 16:31:43 +02:00 committed by GitHub
parent b1ccab1721
commit 78628a5c15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -67,8 +67,12 @@
#include "zfs_comutil.h"
/* Used by fstat(1). */
#ifdef SYSCTL_SIZEOF
SYSCTL_SIZEOF(znode, znode_t);
#else
SYSCTL_INT(_debug_sizeof, OID_AUTO, znode, CTLFLAG_RD,
SYSCTL_NULL_INT_PTR, sizeof (znode_t), "sizeof(znode_t)");
#endif
/*
* Define ZNODE_STATS to turn on statistic gathering. By default, it is only