opnsense-src/sys/fs/devfs
Olivier Certner de6a4418ee
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

(cherry picked from commit 713abc9880aabe0ff924ff644bceb6ff404ed3cd)
(cherry picked from commit efce9f8a510b60736994e50288b78fc7b32b5d90)

Approved by:    re (cperciva)
2025-05-13 14:41:33 +02:00
..
devfs.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
devfs_devs.c sysctl(9): Ease exporting struct sizes; Discourage doing that 2025-05-13 14:41:33 +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-27 19:46:38 -05:00
devfs_rule.c devfs(5): Fix a typo in a source code comment 2024-01-23 07:43:09 +01:00
devfs_vfsops.c Fix MNT_IGNORE for devfs, fdescfs and nullfs 2024-04-22 15:48:15 +02:00
devfs_vnops.c kern: Make fileops and filterops tables const where possible 2024-12-03 01:03:42 +00:00