mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-02-22 01:54:34 +07:00
genetlink: simplify genl_notify
The genl_notify function has too many arguments for no real reason - all callers use genl_info to get them anyway. Just pass the genl_info down to genl_notify. Signed-off-by: Jiri Benc <jbenc@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
06e60e5912
commit
92c14d9b5e
@ -2190,9 +2190,8 @@ static void hwsim_mcast_config_msg(struct sk_buff *mcast_skb,
|
|||||||
struct genl_info *info)
|
struct genl_info *info)
|
||||||
{
|
{
|
||||||
if (info)
|
if (info)
|
||||||
genl_notify(&hwsim_genl_family, mcast_skb,
|
genl_notify(&hwsim_genl_family, mcast_skb, info,
|
||||||
genl_info_net(info), info->snd_portid,
|
HWSIM_MCGRP_CONFIG, GFP_KERNEL);
|
||||||
HWSIM_MCGRP_CONFIG, info->nlhdr, GFP_KERNEL);
|
|
||||||
else
|
else
|
||||||
genlmsg_multicast(&hwsim_genl_family, mcast_skb, 0,
|
genlmsg_multicast(&hwsim_genl_family, mcast_skb, 0,
|
||||||
HWSIM_MCGRP_CONFIG, GFP_KERNEL);
|
HWSIM_MCGRP_CONFIG, GFP_KERNEL);
|
||||||
|
@ -183,9 +183,8 @@ _genl_register_family_with_ops_grps(struct genl_family *family,
|
|||||||
(grps), ARRAY_SIZE(grps))
|
(grps), ARRAY_SIZE(grps))
|
||||||
|
|
||||||
int genl_unregister_family(struct genl_family *family);
|
int genl_unregister_family(struct genl_family *family);
|
||||||
void genl_notify(struct genl_family *family,
|
void genl_notify(struct genl_family *family, struct sk_buff *skb,
|
||||||
struct sk_buff *skb, struct net *net, u32 portid,
|
struct genl_info *info, u32 group, gfp_t flags);
|
||||||
u32 group, struct nlmsghdr *nlh, gfp_t flags);
|
|
||||||
|
|
||||||
struct sk_buff *genlmsg_new_unicast(size_t payload, struct genl_info *info,
|
struct sk_buff *genlmsg_new_unicast(size_t payload, struct genl_info *info,
|
||||||
gfp_t flags);
|
gfp_t flags);
|
||||||
|
@ -1136,19 +1136,19 @@ int genlmsg_multicast_allns(struct genl_family *family, struct sk_buff *skb,
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(genlmsg_multicast_allns);
|
EXPORT_SYMBOL(genlmsg_multicast_allns);
|
||||||
|
|
||||||
void genl_notify(struct genl_family *family,
|
void genl_notify(struct genl_family *family, struct sk_buff *skb,
|
||||||
struct sk_buff *skb, struct net *net, u32 portid, u32 group,
|
struct genl_info *info, u32 group, gfp_t flags)
|
||||||
struct nlmsghdr *nlh, gfp_t flags)
|
|
||||||
{
|
{
|
||||||
|
struct net *net = genl_info_net(info);
|
||||||
struct sock *sk = net->genl_sock;
|
struct sock *sk = net->genl_sock;
|
||||||
int report = 0;
|
int report = 0;
|
||||||
|
|
||||||
if (nlh)
|
if (info->nlhdr)
|
||||||
report = nlmsg_report(nlh);
|
report = nlmsg_report(info->nlhdr);
|
||||||
|
|
||||||
if (WARN_ON_ONCE(group >= family->n_mcgrps))
|
if (WARN_ON_ONCE(group >= family->n_mcgrps))
|
||||||
return;
|
return;
|
||||||
group = family->mcgrp_offset + group;
|
group = family->mcgrp_offset + group;
|
||||||
nlmsg_notify(sk, skb, portid, group, report, flags);
|
nlmsg_notify(sk, skb, info->snd_portid, group, report, flags);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(genl_notify);
|
EXPORT_SYMBOL(genl_notify);
|
||||||
|
@ -91,8 +91,7 @@ static bool ovs_must_notify(struct genl_family *family, struct genl_info *info,
|
|||||||
static void ovs_notify(struct genl_family *family,
|
static void ovs_notify(struct genl_family *family,
|
||||||
struct sk_buff *skb, struct genl_info *info)
|
struct sk_buff *skb, struct genl_info *info)
|
||||||
{
|
{
|
||||||
genl_notify(family, skb, genl_info_net(info), info->snd_portid,
|
genl_notify(family, skb, info, 0, GFP_KERNEL);
|
||||||
0, info->nlhdr, GFP_KERNEL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user