Commit 87a2e2c
drbd: switch from genl_magic macros to YNL-generated code
Replace the genl_magic multi-include macro system with proper YNL
generation.
The bulk of the changes are mechanical renames to fit the generator
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 to generate, so make this 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.
Define the genl_family struct manually in drbd_nl.c; this is not
emitted by the generator for genetlink-legacy families.
Also replace a couple of drbd-specific wrappers (nla_put_u64_0pad,
drbd_nla_find_nested) and replace by 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>1 parent 5478d3d commit 87a2e2c
13 files changed
Lines changed: 3618 additions & 1422 deletions
File tree
- drivers/block/drbd
- include
- linux
- uapi/linux
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
844 | 844 | | |
845 | 845 | | |
846 | 846 | | |
847 | | - | |
| 847 | + | |
848 | 848 | | |
849 | 849 | | |
850 | 850 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2324 | 2324 | | |
2325 | 2325 | | |
2326 | 2326 | | |
2327 | | - | |
| 2327 | + | |
2328 | 2328 | | |
2329 | 2329 | | |
2330 | 2330 | | |
| |||
2846 | 2846 | | |
2847 | 2847 | | |
2848 | 2848 | | |
2849 | | - | |
| 2849 | + | |
2850 | 2850 | | |
2851 | 2851 | | |
2852 | 2852 | | |
| |||
2876 | 2876 | | |
2877 | 2877 | | |
2878 | 2878 | | |
2879 | | - | |
| 2879 | + | |
2880 | 2880 | | |
2881 | 2881 | | |
2882 | 2882 | | |
| |||
0 commit comments