From 78628a5c15f2c6812ce45dd64c7f4b0825faf68d Mon Sep 17 00:00:00 2001 From: Olivier Certner Date: Thu, 8 May 2025 16:31:43 +0200 Subject: [PATCH] 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 Reviewed-by: Tony Hutter Signed-off-by: Olivier Certner Closes #17309 --- module/os/freebsd/zfs/zfs_znode_os.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module/os/freebsd/zfs/zfs_znode_os.c b/module/os/freebsd/zfs/zfs_znode_os.c index ce7b93d20..e97a0dd84 100644 --- a/module/os/freebsd/zfs/zfs_znode_os.c +++ b/module/os/freebsd/zfs/zfs_znode_os.c @@ -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