Christoph Böhmwalder
630bbba45c
drbd: use genl pre_doit/post_doit
...
Every doit handler followed the same pattern: stack-allocate an
adm_ctx, call drbd_adm_prepare() at the top, call drbd_adm_finish()
at the bottom. This duplicated boilerplate across 25 handlers and
made error paths inconsistent, since some handlers could miss sending
the reply skb on early-exit paths.
The generic netlink framework already provides pre_doit/post_doit
hooks for exactly this purpose. An old comment even noted "this
would be a good candidate for a pre_doit hook".
Use them:
- pre_doit heap-allocates adm_ctx, looks up per-command flags from a
new drbd_genl_cmd_flags[] table, runs drbd_adm_prepare(), and
stores the context in info->user_ptr[0].
- post_doit sends the reply, drops kref references for
device/connection/resource, and frees the adm_ctx.
- Handlers just receive adm_ctx from info->user_ptr[0], set
reply_dh->ret_code, and return. All teardown is in post_doit.
- drbd_adm_finish() is removed, superseded by post_doit.
Signed-off-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com >
Link: https://patch.msgid.link/20260324152907.2840984-1-christoph.boehmwalder@linbit.com
Signed-off-by: Jens Axboe <axboe@kernel.dk >
2026-03-25 07:11:10 -06:00
..
2026-03-05 15:21:17 -06:00
2026-02-21 17:09:51 -08:00
2026-03-05 18:46:43 +01:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-03-06 09:58:47 +01:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-03-03 13:12:42 +01:00
2026-02-21 17:09:51 -08:00
2026-03-25 07:11:10 -06:00
2026-02-26 08:00:13 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-26 14:34:21 -08:00
2026-02-24 12:54:17 +01:00
2026-02-22 08:26:33 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-25 14:39:19 +01:00
2026-02-21 17:09:51 -08:00
2026-02-28 12:53:25 +09:00
2026-02-24 08:33:30 -07:00
2026-02-21 17:09:51 -08:00
2026-02-21 01:02:28 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 20:03:00 -08:00
2026-02-26 08:00:13 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-28 10:09:24 -08:00
2026-02-25 12:02:48 +01:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-23 11:49:23 +01:00
2026-03-06 19:45:19 +10:00
2026-02-21 20:03:00 -08:00
2026-03-06 10:00:58 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-03-04 16:48:06 -08:00
2026-02-10 20:45:30 -08:00
2026-02-21 20:03:00 -08:00
2026-03-04 12:44:14 +01:00
2026-02-21 20:03:00 -08:00
2026-01-07 21:17:43 +01:00
2026-02-22 08:26:33 -08:00
2026-02-26 04:58:24 -05:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 20:03:00 -08:00
2026-03-01 15:34:47 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 01:02:28 -08:00
2026-02-21 17:09:51 -08:00
2026-03-23 02:15:11 +08:00
2026-03-04 08:12:06 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 20:03:00 -08:00
2026-02-23 12:05:20 +01:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-03-07 07:44:32 -08:00
2026-02-26 08:00:13 -08:00
2026-02-21 11:02:58 -08:00
2026-02-21 17:09:51 -08:00
2026-03-09 07:47:02 -06:00
2026-03-14 07:44:30 -06:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-03-07 07:44:32 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-26 23:41:04 +01:00
2026-03-03 14:45:17 +02:00
2026-03-06 09:16:39 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-03-02 14:46:28 +00:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 09:43:11 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-03-19 11:38:24 -06:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-22 08:26:33 -08:00
2026-03-02 22:33:32 +00:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-03-09 14:30:00 -06:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 20:03:00 -08:00
2026-02-22 08:26:33 -08:00
2026-02-24 14:23:07 -05:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 20:03:00 -08:00
2026-02-22 08:26:33 -08:00
2026-03-05 17:35:12 +01:00
2026-02-22 08:26:33 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-03-07 07:44:32 -08:00
2026-02-21 17:09:51 -08:00
2026-02-04 20:45:26 +05:30