opnsense-src/sys/geom
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
..
bde sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
cache sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
concat sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
eli pkcs5v2: Add pkcs5v2_genkey_raw function 2024-09-29 08:24:52 -07:00
gate ggate: Avoid dropping the GEOM topology lock in dumpconf 2024-10-18 12:27:13 +00:00
journal gjournal(8): Fix a typo in a sysctl description 2024-01-25 07:43:16 +01:00
label sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
linux_lvm geom_linux_lvm: Avoid removing from vg_list before inserting 2023-10-24 09:17:59 -04:00
mirror g_eli: update comment for bool return type 2024-11-16 09:59:52 -05:00
mountver geom: sort includes for some files 2023-12-08 18:02:44 -04:00
multipath sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
nop sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
part geom: Allow BSD type '!0' partitions 2024-12-21 17:04:07 +00:00
raid graid: MFC: unbreak Promise RAID1 with 4+ providers 2024-02-16 12:18:43 +07:00
raid3 graid3: Fix teardown in g_raid3_try_destroy() 2024-04-23 09:51:33 -04:00
shsec sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
stripe geom_stripe: Cascade cantrim just like we do for gmirror 2024-05-20 13:23:40 -06:00
union spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
uzip sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
vinum gvinum: Emit deprecation notice upon drive tasting 2025-02-04 08:35:32 -05:00
virstor sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
zero sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
geom.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
geom_bsd_enc.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
geom_ccd.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
geom_ctl.c geom: Report copyout() errors in g_ctl_ioctl_ctl() 2024-01-01 19:29:57 -05:00
geom_ctl.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
geom_dbg.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
geom_dev.c g_dev_orphan(): Return early if the device is already gone 2025-03-14 11:51:03 -06:00
geom_disk.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
geom_disk.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
geom_dump.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
geom_event.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
geom_flashmap.c geom_flashmap: Rename the kernel module 2024-11-05 00:55:43 +00:00
geom_flashmap.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
geom_int.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
geom_io.c Fix geom build with clang 17 and KTR enabled 2023-09-20 09:03:55 +02:00
geom_kern.c sysctl(9): Ease exporting struct sizes; Discourage doing that 2025-05-13 14:41:33 +02:00
geom_slice.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
geom_slice.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
geom_subr.c geom(4): Fix a typo in a source code comment 2024-04-24 12:19:28 +02:00
geom_vfs.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
geom_vfs.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
notes sys: Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:17 -06:00