opnsense-src/sys/fs/devfs
Olivier Certner 713abc9880
sysctl(9): Ease exporting struct sizes; Discourage doing that
Introduce two helpers, the more general SYSCTL_SIZEOF() and
a struct-specific one SYSCTL_SIZEOF_STRUCT() which prepends 'struct' in
the description and in the use of sizeof() but uses the raw structure
name as the knob's name.  The size of the object/structure is exported
under 'debug.sizeof'.

Existing knobs under 'debug.sizeof' were all converted to use the
helpers.

Add a note before the helpers discouraging the introduction of new
leaves for ad-hoc reasons.  List alternative means for developers to
obtain the size of arbitrary kernel structures easily (thanks to markj@
for providing these).

No functional change (intended).

Reviewed by:    kib, markj
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D50121
2025-05-07 12:13:40 +02:00
..
devfs.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
devfs_devs.c sysctl(9): Ease exporting struct sizes; Discourage doing that 2025-05-07 12:13:40 +02:00
devfs_dir.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
devfs_int.h devfs: add integrity asserts for cdevp_list 2023-09-21 11:51:12 -05:00
devfs_rule.c devfs(5): Fix a typo in a source code comment 2024-01-20 17:25:45 +01:00
devfs_vfsops.c sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
devfs_vnops.c kern: Make fileops and filterops tables const where possible 2024-11-26 21:04:21 +00:00