nfnetlink: Revert "nfnetlink: add support for memory mapped netlink"

reverts commit 3ab1f683bf ("nfnetlink: add support for memory mapped
netlink")'

Like previous commits in the series, remove wrappers that are not needed
after mmapped netlink removal.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Florian Westphal 2016-02-18 15:03:28 +01:00 committed by David S. Miller
parent 905f0a739a
commit c5b0db3263
3 changed files with 6 additions and 30 deletions

View File

@ -69,16 +69,6 @@ extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group)
extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
extern int netlink_has_listeners(struct sock *sk, unsigned int group); extern int netlink_has_listeners(struct sock *sk, unsigned int group);
extern struct sk_buff *__netlink_alloc_skb(struct sock *ssk, unsigned int size,
unsigned int ldiff, u32 dst_portid,
gfp_t gfp_mask);
static inline struct sk_buff *
netlink_alloc_skb(struct sock *ssk, unsigned int size, u32 dst_portid,
gfp_t gfp_mask)
{
return __netlink_alloc_skb(ssk, size, 0, dst_portid, gfp_mask);
}
extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 portid, int nonblock); extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 portid, int nonblock);
extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 portid, extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 portid,
__u32 group, gfp_t allocation); __u32 group, gfp_t allocation);

View File

@ -301,7 +301,7 @@ nfqnl_build_packet_message(struct net *net, struct nfqnl_instance *queue,
__be32 **packet_id_ptr) __be32 **packet_id_ptr)
{ {
size_t size; size_t size;
size_t data_len = 0, cap_len = 0, rem_len = 0; size_t data_len = 0, cap_len = 0;
unsigned int hlen = 0; unsigned int hlen = 0;
struct sk_buff *skb; struct sk_buff *skb;
struct nlattr *nla; struct nlattr *nla;
@ -361,7 +361,6 @@ nfqnl_build_packet_message(struct net *net, struct nfqnl_instance *queue,
hlen = min_t(unsigned int, hlen, data_len); hlen = min_t(unsigned int, hlen, data_len);
size += sizeof(struct nlattr) + hlen; size += sizeof(struct nlattr) + hlen;
cap_len = entskb->len; cap_len = entskb->len;
rem_len = data_len - hlen;
break; break;
} }
@ -386,8 +385,7 @@ nfqnl_build_packet_message(struct net *net, struct nfqnl_instance *queue,
size += nla_total_size(seclen); size += nla_total_size(seclen);
} }
skb = __netlink_alloc_skb(net->nfnl, size, rem_len, queue->peer_portid, skb = alloc_skb(size, GFP_ATOMIC);
GFP_ATOMIC);
if (!skb) { if (!skb) {
skb_tx_error(entskb); skb_tx_error(entskb);
return NULL; return NULL;

View File

@ -1248,14 +1248,6 @@ int netlink_unicast(struct sock *ssk, struct sk_buff *skb,
} }
EXPORT_SYMBOL(netlink_unicast); EXPORT_SYMBOL(netlink_unicast);
struct sk_buff *__netlink_alloc_skb(struct sock *ssk, unsigned int size,
unsigned int ldiff, u32 dst_portid,
gfp_t gfp_mask)
{
return alloc_skb(size, gfp_mask);
}
EXPORT_SYMBOL_GPL(__netlink_alloc_skb);
int netlink_has_listeners(struct sock *sk, unsigned int group) int netlink_has_listeners(struct sock *sk, unsigned int group)
{ {
int res = 0; int res = 0;
@ -2082,15 +2074,12 @@ static int netlink_dump(struct sock *sk)
if (alloc_min_size < nlk->max_recvmsg_len) { if (alloc_min_size < nlk->max_recvmsg_len) {
alloc_size = nlk->max_recvmsg_len; alloc_size = nlk->max_recvmsg_len;
skb = netlink_alloc_skb(sk, alloc_size, nlk->portid, skb = alloc_skb(alloc_size, GFP_KERNEL |
GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY);
__GFP_NOWARN |
__GFP_NORETRY);
} }
if (!skb) { if (!skb) {
alloc_size = alloc_min_size; alloc_size = alloc_min_size;
skb = netlink_alloc_skb(sk, alloc_size, nlk->portid, skb = alloc_skb(alloc_size, GFP_KERNEL);
GFP_KERNEL);
} }
if (!skb) if (!skb)
goto errout_skb; goto errout_skb;
@ -2230,8 +2219,7 @@ void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err)
if (!(nlk->flags & NETLINK_F_CAP_ACK) && err) if (!(nlk->flags & NETLINK_F_CAP_ACK) && err)
payload += nlmsg_len(nlh); payload += nlmsg_len(nlh);
skb = netlink_alloc_skb(in_skb->sk, nlmsg_total_size(payload), skb = nlmsg_new(payload, GFP_KERNEL);
NETLINK_CB(in_skb).portid, GFP_KERNEL);
if (!skb) { if (!skb) {
struct sock *sk; struct sock *sk;