diff options
| -rw-r--r-- | include/net/sock.h | 10 | ||||
| -rw-r--r-- | net/ipv4/tcp.c | 11 | ||||
| -rw-r--r-- | net/ipv4/tcp_output.c | 2 |
3 files changed, 6 insertions, 17 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 7d500a825e4e..bcbf8891dde4 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -1192,15 +1192,7 @@ static inline void sk_stream_moderate_sndbuf(struct sock *sk) | |||
| 1192 | } | 1192 | } |
| 1193 | } | 1193 | } |
| 1194 | 1194 | ||
| 1195 | struct sk_buff *sk_stream_alloc_pskb(struct sock *sk, | 1195 | struct sk_buff *sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp); |
| 1196 | int size, int mem, gfp_t gfp); | ||
| 1197 | |||
| 1198 | static inline struct sk_buff *sk_stream_alloc_skb(struct sock *sk, | ||
| 1199 | int size, | ||
| 1200 | gfp_t gfp) | ||
| 1201 | { | ||
| 1202 | return sk_stream_alloc_pskb(sk, size, 0, gfp); | ||
| 1203 | } | ||
| 1204 | 1196 | ||
| 1205 | static inline struct page *sk_stream_alloc_page(struct sock *sk) | 1197 | static inline struct page *sk_stream_alloc_page(struct sock *sk) |
| 1206 | { | 1198 | { |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 6b35ab841db2..eb77088f3054 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
| @@ -629,8 +629,7 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos, | |||
| 629 | return ret; | 629 | return ret; |
| 630 | } | 630 | } |
| 631 | 631 | ||
| 632 | struct sk_buff *sk_stream_alloc_pskb(struct sock *sk, | 632 | struct sk_buff *sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp) |
| 633 | int size, int mem, gfp_t gfp) | ||
| 634 | { | 633 | { |
| 635 | struct sk_buff *skb; | 634 | struct sk_buff *skb; |
| 636 | 635 | ||
| @@ -639,7 +638,6 @@ struct sk_buff *sk_stream_alloc_pskb(struct sock *sk, | |||
| 639 | 638 | ||
| 640 | skb = alloc_skb_fclone(size + sk->sk_prot->max_header, gfp); | 639 | skb = alloc_skb_fclone(size + sk->sk_prot->max_header, gfp); |
| 641 | if (skb) { | 640 | if (skb) { |
| 642 | skb->truesize += mem; | ||
| 643 | if (sk_stream_wmem_schedule(sk, skb->truesize)) { | 641 | if (sk_stream_wmem_schedule(sk, skb->truesize)) { |
| 644 | /* | 642 | /* |
| 645 | * Make sure that we have exactly size bytes | 643 | * Make sure that we have exactly size bytes |
| @@ -692,8 +690,7 @@ new_segment: | |||
| 692 | if (!sk_stream_memory_free(sk)) | 690 | if (!sk_stream_memory_free(sk)) |
| 693 | goto wait_for_sndbuf; | 691 | goto wait_for_sndbuf; |
| 694 | 692 | ||
| 695 | skb = sk_stream_alloc_pskb(sk, 0, 0, | 693 | skb = sk_stream_alloc_skb(sk, 0, sk->sk_allocation); |
| 696 | sk->sk_allocation); | ||
| 697 | if (!skb) | 694 | if (!skb) |
| 698 | goto wait_for_memory; | 695 | goto wait_for_memory; |
| 699 | 696 | ||
| @@ -873,8 +870,8 @@ new_segment: | |||
| 873 | if (!sk_stream_memory_free(sk)) | 870 | if (!sk_stream_memory_free(sk)) |
| 874 | goto wait_for_sndbuf; | 871 | goto wait_for_sndbuf; |
| 875 | 872 | ||
| 876 | skb = sk_stream_alloc_pskb(sk, select_size(sk), | 873 | skb = sk_stream_alloc_skb(sk, select_size(sk), |
| 877 | 0, sk->sk_allocation); | 874 | sk->sk_allocation); |
| 878 | if (!skb) | 875 | if (!skb) |
| 879 | goto wait_for_memory; | 876 | goto wait_for_memory; |
| 880 | 877 | ||
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 546f385a405f..98835afb8d8a 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
| @@ -1180,7 +1180,7 @@ static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len, | |||
| 1180 | if (skb->len != skb->data_len) | 1180 | if (skb->len != skb->data_len) |
| 1181 | return tcp_fragment(sk, skb, len, mss_now); | 1181 | return tcp_fragment(sk, skb, len, mss_now); |
| 1182 | 1182 | ||
| 1183 | buff = sk_stream_alloc_pskb(sk, 0, 0, GFP_ATOMIC); | 1183 | buff = sk_stream_alloc_skb(sk, 0, GFP_ATOMIC); |
| 1184 | if (unlikely(buff == NULL)) | 1184 | if (unlikely(buff == NULL)) |
| 1185 | return -ENOMEM; | 1185 | return -ENOMEM; |
| 1186 | 1186 | ||
