Skip to content

Commit 66a9b92

Browse files
kuba-moodavem330
authored andcommitted
genetlink: move to smaller ops wherever possible
Bulk of the genetlink users can use smaller ops, move them. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0b588af commit 66a9b92

32 files changed

Lines changed: 107 additions & 102 deletions

‎drivers/block/nbd.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2183,7 +2183,7 @@ static int nbd_genl_reconfigure(struct sk_buff *skb, struct genl_info *info)
21832183
return ret;
21842184
}
21852185

2186-
static const struct genl_ops nbd_connect_genl_ops[] = {
2186+
static const struct genl_small_ops nbd_connect_genl_ops[] = {
21872187
{
21882188
.cmd = NBD_CMD_CONNECT,
21892189
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
@@ -2215,8 +2215,8 @@ static struct genl_family nbd_genl_family __ro_after_init = {
22152215
.name = NBD_GENL_FAMILY_NAME,
22162216
.version = NBD_GENL_VERSION,
22172217
.module = THIS_MODULE,
2218-
.ops = nbd_connect_genl_ops,
2219-
.n_ops = ARRAY_SIZE(nbd_connect_genl_ops),
2218+
.small_ops = nbd_connect_genl_ops,
2219+
.n_small_ops = ARRAY_SIZE(nbd_connect_genl_ops),
22202220
.maxattr = NBD_ATTR_MAX,
22212221
.policy = nbd_attr_policy,
22222222
.mcgrps = nbd_mcast_grps,

‎drivers/net/gtp.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ static const struct nla_policy gtp_genl_policy[GTPA_MAX + 1] = {
13391339
[GTPA_O_TEI] = { .type = NLA_U32, },
13401340
};
13411341

1342-
static const struct genl_ops gtp_genl_ops[] = {
1342+
static const struct genl_small_ops gtp_genl_ops[] = {
13431343
{
13441344
.cmd = GTP_CMD_NEWPDP,
13451345
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
@@ -1369,8 +1369,8 @@ static struct genl_family gtp_genl_family __ro_after_init = {
13691369
.policy = gtp_genl_policy,
13701370
.netnsok = true,
13711371
.module = THIS_MODULE,
1372-
.ops = gtp_genl_ops,
1373-
.n_ops = ARRAY_SIZE(gtp_genl_ops),
1372+
.small_ops = gtp_genl_ops,
1373+
.n_small_ops = ARRAY_SIZE(gtp_genl_ops),
13741374
.mcgrps = gtp_genl_mcgrps,
13751375
.n_mcgrps = ARRAY_SIZE(gtp_genl_mcgrps),
13761376
};

‎drivers/net/ieee802154/mac802154_hwsim.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ static const struct nla_policy hwsim_genl_policy[MAC802154_HWSIM_ATTR_MAX + 1] =
583583
};
584584

585585
/* Generic Netlink operations array */
586-
static const struct genl_ops hwsim_nl_ops[] = {
586+
static const struct genl_small_ops hwsim_nl_ops[] = {
587587
{
588588
.cmd = MAC802154_HWSIM_CMD_NEW_RADIO,
589589
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
@@ -628,8 +628,8 @@ static struct genl_family hwsim_genl_family __ro_after_init = {
628628
.maxattr = MAC802154_HWSIM_ATTR_MAX,
629629
.policy = hwsim_genl_policy,
630630
.module = THIS_MODULE,
631-
.ops = hwsim_nl_ops,
632-
.n_ops = ARRAY_SIZE(hwsim_nl_ops),
631+
.small_ops = hwsim_nl_ops,
632+
.n_small_ops = ARRAY_SIZE(hwsim_nl_ops),
633633
.mcgrps = hwsim_mcgrps,
634634
.n_mcgrps = ARRAY_SIZE(hwsim_mcgrps),
635635
};

‎drivers/net/macsec.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3285,7 +3285,7 @@ static int macsec_dump_txsc(struct sk_buff *skb, struct netlink_callback *cb)
32853285
return skb->len;
32863286
}
32873287

3288-
static const struct genl_ops macsec_genl_ops[] = {
3288+
static const struct genl_small_ops macsec_genl_ops[] = {
32893289
{
32903290
.cmd = MACSEC_CMD_GET_TXSC,
32913291
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
@@ -3361,8 +3361,8 @@ static struct genl_family macsec_fam __ro_after_init = {
33613361
.policy = macsec_genl_policy,
33623362
.netnsok = true,
33633363
.module = THIS_MODULE,
3364-
.ops = macsec_genl_ops,
3365-
.n_ops = ARRAY_SIZE(macsec_genl_ops),
3364+
.small_ops = macsec_genl_ops,
3365+
.n_small_ops = ARRAY_SIZE(macsec_genl_ops),
33663366
};
33673367

33683368
static netdev_tx_t macsec_start_xmit(struct sk_buff *skb,

‎drivers/net/team/team.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2795,7 +2795,7 @@ static int team_nl_cmd_port_list_get(struct sk_buff *skb,
27952795
return err;
27962796
}
27972797

2798-
static const struct genl_ops team_nl_ops[] = {
2798+
static const struct genl_small_ops team_nl_ops[] = {
27992799
{
28002800
.cmd = TEAM_CMD_NOOP,
28012801
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
@@ -2832,8 +2832,8 @@ static struct genl_family team_nl_family __ro_after_init = {
28322832
.policy = team_nl_policy,
28332833
.netnsok = true,
28342834
.module = THIS_MODULE,
2835-
.ops = team_nl_ops,
2836-
.n_ops = ARRAY_SIZE(team_nl_ops),
2835+
.small_ops = team_nl_ops,
2836+
.n_small_ops = ARRAY_SIZE(team_nl_ops),
28372837
.mcgrps = team_nl_mcgrps,
28382838
.n_mcgrps = ARRAY_SIZE(team_nl_mcgrps),
28392839
};

‎drivers/net/wireless/mac80211_hwsim.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3964,7 +3964,7 @@ static int hwsim_dump_radio_nl(struct sk_buff *skb,
39643964
}
39653965

39663966
/* Generic Netlink operations array */
3967-
static const struct genl_ops hwsim_ops[] = {
3967+
static const struct genl_small_ops hwsim_ops[] = {
39683968
{
39693969
.cmd = HWSIM_CMD_REGISTER,
39703970
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
@@ -4008,8 +4008,8 @@ static struct genl_family hwsim_genl_family __ro_after_init = {
40084008
.policy = hwsim_genl_policy,
40094009
.netnsok = true,
40104010
.module = THIS_MODULE,
4011-
.ops = hwsim_ops,
4012-
.n_ops = ARRAY_SIZE(hwsim_ops),
4011+
.small_ops = hwsim_ops,
4012+
.n_small_ops = ARRAY_SIZE(hwsim_ops),
40134013
.mcgrps = hwsim_mcgrps,
40144014
.n_mcgrps = ARRAY_SIZE(hwsim_mcgrps),
40154015
};

‎drivers/target/target_core_user.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ static int tcmu_genl_set_features(struct sk_buff *skb, struct genl_info *info)
436436
return 0;
437437
}
438438

439-
static const struct genl_ops tcmu_genl_ops[] = {
439+
static const struct genl_small_ops tcmu_genl_ops[] = {
440440
{
441441
.cmd = TCMU_CMD_SET_FEATURES,
442442
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
@@ -474,8 +474,8 @@ static struct genl_family tcmu_genl_family __ro_after_init = {
474474
.mcgrps = tcmu_mcgrps,
475475
.n_mcgrps = ARRAY_SIZE(tcmu_mcgrps),
476476
.netnsok = true,
477-
.ops = tcmu_genl_ops,
478-
.n_ops = ARRAY_SIZE(tcmu_genl_ops),
477+
.small_ops = tcmu_genl_ops,
478+
.n_small_ops = ARRAY_SIZE(tcmu_genl_ops),
479479
};
480480

481481
#define tcmu_cmd_set_dbi_cur(cmd, index) ((cmd)->dbi_cur = (index))

‎drivers/thermal/thermal_netlink.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ static int thermal_genl_cmd_doit(struct sk_buff *skb,
601601
return ret;
602602
}
603603

604-
static const struct genl_ops thermal_genl_ops[] = {
604+
static const struct genl_small_ops thermal_genl_ops[] = {
605605
{
606606
.cmd = THERMAL_GENL_CMD_TZ_GET_ID,
607607
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
@@ -635,8 +635,8 @@ static struct genl_family thermal_gnl_family __ro_after_init = {
635635
.version = THERMAL_GENL_VERSION,
636636
.maxattr = THERMAL_GENL_ATTR_MAX,
637637
.policy = thermal_genl_policy,
638-
.ops = thermal_genl_ops,
639-
.n_ops = ARRAY_SIZE(thermal_genl_ops),
638+
.small_ops = thermal_genl_ops,
639+
.n_small_ops = ARRAY_SIZE(thermal_genl_ops),
640640
.mcgrps = thermal_genl_mcgrps,
641641
.n_mcgrps = ARRAY_SIZE(thermal_genl_mcgrps),
642642
};

‎fs/dlm/netlink.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static int user_cmd(struct sk_buff *skb, struct genl_info *info)
6262
return 0;
6363
}
6464

65-
static const struct genl_ops dlm_nl_ops[] = {
65+
static const struct genl_small_ops dlm_nl_ops[] = {
6666
{
6767
.cmd = DLM_CMD_HELLO,
6868
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
@@ -73,8 +73,8 @@ static const struct genl_ops dlm_nl_ops[] = {
7373
static struct genl_family family __ro_after_init = {
7474
.name = DLM_GENL_NAME,
7575
.version = DLM_GENL_VERSION,
76-
.ops = dlm_nl_ops,
77-
.n_ops = ARRAY_SIZE(dlm_nl_ops),
76+
.small_ops = dlm_nl_ops,
77+
.n_small_ops = ARRAY_SIZE(dlm_nl_ops),
7878
.module = THIS_MODULE,
7979
};
8080

‎kernel/taskstats.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ void taskstats_exit(struct task_struct *tsk, int group_dead)
644644
nlmsg_free(rep_skb);
645645
}
646646

647-
static const struct genl_ops taskstats_ops[] = {
647+
static const struct genl_small_ops taskstats_ops[] = {
648648
{
649649
.cmd = TASKSTATS_CMD_GET,
650650
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
@@ -687,8 +687,8 @@ static struct genl_family family __ro_after_init = {
687687
.version = TASKSTATS_GENL_VERSION,
688688
.maxattr = TASKSTATS_CMD_ATTR_MAX,
689689
.module = THIS_MODULE,
690-
.ops = taskstats_ops,
691-
.n_ops = ARRAY_SIZE(taskstats_ops),
690+
.small_ops = taskstats_ops,
691+
.n_small_ops = ARRAY_SIZE(taskstats_ops),
692692
.pre_doit = taskstats_pre_doit,
693693
};
694694

0 commit comments

Comments
 (0)