mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
netlink: introduce typedef for filter function
Make the code using filter function a bit nicer by consolidating the filter function arguments using typedef. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
a731132424
commit
403863e985
@ -59,9 +59,8 @@ static int cn_already_initialized;
|
||||
* both, or if both are zero then the group is looked up and sent there.
|
||||
*/
|
||||
int cn_netlink_send_mult(struct cn_msg *msg, u16 len, u32 portid, u32 __group,
|
||||
gfp_t gfp_mask,
|
||||
int (*filter)(struct sock *dsk, struct sk_buff *skb, void *data),
|
||||
void *filter_data)
|
||||
gfp_t gfp_mask, netlink_filter_fn filter,
|
||||
void *filter_data)
|
||||
{
|
||||
struct cn_callback_entry *__cbq;
|
||||
unsigned int size;
|
||||
|
@ -100,8 +100,7 @@ void cn_del_callback(const struct cb_id *id);
|
||||
*/
|
||||
int cn_netlink_send_mult(struct cn_msg *msg, u16 len, u32 portid,
|
||||
u32 group, gfp_t gfp_mask,
|
||||
int (*filter)(struct sock *dsk, struct sk_buff *skb,
|
||||
void *data),
|
||||
netlink_filter_fn filter,
|
||||
void *filter_data);
|
||||
|
||||
/**
|
||||
|
@ -228,10 +228,12 @@ bool netlink_strict_get_check(struct sk_buff *skb);
|
||||
int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 portid, int nonblock);
|
||||
int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 portid,
|
||||
__u32 group, gfp_t allocation);
|
||||
|
||||
typedef int (*netlink_filter_fn)(struct sock *dsk, struct sk_buff *skb, void *data);
|
||||
|
||||
int netlink_broadcast_filtered(struct sock *ssk, struct sk_buff *skb,
|
||||
__u32 portid, __u32 group, gfp_t allocation,
|
||||
int (*filter)(struct sock *dsk,
|
||||
struct sk_buff *skb, void *data),
|
||||
netlink_filter_fn filter,
|
||||
void *filter_data);
|
||||
int netlink_set_err(struct sock *ssk, __u32 portid, __u32 group, int code);
|
||||
int netlink_register_notifier(struct notifier_block *nb);
|
||||
|
@ -1519,8 +1519,7 @@ out:
|
||||
int netlink_broadcast_filtered(struct sock *ssk, struct sk_buff *skb,
|
||||
u32 portid,
|
||||
u32 group, gfp_t allocation,
|
||||
int (*filter)(struct sock *dsk,
|
||||
struct sk_buff *skb, void *data),
|
||||
netlink_filter_fn filter,
|
||||
void *filter_data)
|
||||
{
|
||||
struct net *net = sock_net(ssk);
|
||||
|
Loading…
Reference in New Issue
Block a user