linux/drivers/block/drbd
Christoph Böhmwalder 8098eeb693 drbd: replace genl_magic with explicit netlink serialization
Replace the genl_magic multi-include macro system with explicit
serialization and parsing.

The *_gen files were initially produced from a YNL spec via a
customized ynl-gen-c, but the DRBD netlink family is effectively
frozen, so the generator is kept unmodified.
All new functionality will land in a separate, properly-designed
family.
Carry the resulting code as ordinary in-tree source rather than
landing the spec and generator changes that produced it.

The bulk of the changes are mechanical renames to fit the YNL naming
conventions:
  - Handler functions: drbd_adm_* -> drbd_nl_*_doit/dumpit
  - GENL_MAGIC_VERSION -> DRBD_FAMILY_VERSION
  - GENL_MAGIC_FAMILY_HDRSZ -> sizeof(struct drbd_genlmsghdr)
  - drbd_genl_family -> drbd_nl_family
  - Attribute IDs: T_* -> DRBD_A_*

Remove the nested_attr_tb static global buffer and move to a per-call
allocation approach: each deserialization manages its own nested
attribute table. This will be needed anyway when we eventually move
to parallel_ops, and it's actually simpler this way, so make the
move now.

Replace the functionality of the "sensitive" flag: this was only used
by a single field (shared_secret); open-code redaction logic for that
locally.

Also replace the "invariant" flag: this only had a couple of users,
and those basically never change. Hard code the check directly inline.

The genl_family struct itself is defined manually in drbd_nl.c.

Also replace a couple of drbd-specific wrappers (nla_put_u64_0pad,
drbd_nla_find_nested) with standard kernel functions while we're at
it.

Finally, completely remove the genl_magic system; DRBD was its only
user.

Signed-off-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Link: https://patch.msgid.link/20260506124541.1951772-3-christoph.boehmwalder@linbit.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2026-05-08 19:23:23 -06:00
..
drbd_actlog.c drbd: fix "LOGIC BUG" in drbd_al_begin_io_nonblock() 2026-02-19 08:21:53 -07:00
drbd_bitmap.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
drbd_buildtag.c drbd: move UAPI headers to include/uapi/linux/ 2026-05-08 19:23:23 -06:00
drbd_config.h drbd: move UAPI headers to include/uapi/linux/ 2026-05-08 19:23:23 -06:00
drbd_debugfs.c drbd: replace genl_magic with explicit netlink serialization 2026-05-08 19:23:23 -06:00
drbd_debugfs.h drbd: use consistent license 2022-11-22 19:38:39 -07:00
drbd_int.h drbd: replace genl_magic with explicit netlink serialization 2026-05-08 19:23:23 -06:00
drbd_interval.c drbd: drbd_insert_interval(): Clarify comment 2023-01-29 15:18:33 -07:00
drbd_interval.h drbd: fix "LOGIC BUG" in drbd_al_begin_io_nonblock() 2026-02-19 08:21:53 -07:00
drbd_main.c drbd: replace genl_magic with explicit netlink serialization 2026-05-08 19:23:23 -06:00
drbd_nl_gen.c drbd: replace genl_magic with explicit netlink serialization 2026-05-08 19:23:23 -06:00
drbd_nl_gen.h drbd: replace genl_magic with explicit netlink serialization 2026-05-08 19:23:23 -06:00
drbd_nl.c drbd: replace genl_magic with explicit netlink serialization 2026-05-08 19:23:23 -06:00
drbd_polymorph_printk.h drbd: add context parameter to expect() macro 2022-12-01 11:33:49 -07:00
drbd_proc.c drbd: replace genl_magic with explicit netlink serialization 2026-05-08 19:23:23 -06:00
drbd_protocol.h drbd: use consistent license 2022-11-22 19:38:39 -07:00
drbd_receiver.c block-7.0-20260227 2026-02-27 10:42:02 -08:00
drbd_req.c drbd: fix null-pointer dereference on local read error 2026-02-20 07:09:06 -07:00
drbd_req.h drbd: pass drbd_peer_device to __req_mod 2023-04-01 20:27:55 -06:00
drbd_state_change.h drbd: fix function cast warnings in state machine 2024-02-13 08:55:40 -07:00
drbd_state.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
drbd_state.h drbd: use consistent license 2022-11-22 19:38:39 -07:00
drbd_strings.c drbd: use consistent license 2022-11-22 19:38:39 -07:00
drbd_strings.h drbd: use consistent license 2022-11-22 19:38:39 -07:00
drbd_vli.h drbd: remove unnecessary assignment in vli_encode_bits 2023-01-29 15:18:33 -07:00
drbd_worker.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
Kconfig lib/crc: remove CONFIG_LIBCRC32C 2025-04-04 11:31:42 -07:00
Makefile drbd: replace genl_magic with explicit netlink serialization 2026-05-08 19:23:23 -06:00