Commit 5882efff authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

tcp: remove size parameter from tcp_stream_alloc_skb()

Now all tcp_stream_alloc_skb() callers pass @size == 0, we can
remove this parameter.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b4a24397
...@@ -350,7 +350,7 @@ void tcp_twsk_purge(struct list_head *net_exit_list, int family); ...@@ -350,7 +350,7 @@ void tcp_twsk_purge(struct list_head *net_exit_list, int family);
ssize_t tcp_splice_read(struct socket *sk, loff_t *ppos, ssize_t tcp_splice_read(struct socket *sk, loff_t *ppos,
struct pipe_inode_info *pipe, size_t len, struct pipe_inode_info *pipe, size_t len,
unsigned int flags); unsigned int flags);
struct sk_buff *tcp_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp, struct sk_buff *tcp_stream_alloc_skb(struct sock *sk, gfp_t gfp,
bool force_schedule); bool force_schedule);
void tcp_enter_quickack_mode(struct sock *sk, unsigned int max_quickacks); void tcp_enter_quickack_mode(struct sock *sk, unsigned int max_quickacks);
......
...@@ -858,12 +858,12 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos, ...@@ -858,12 +858,12 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,
} }
EXPORT_SYMBOL(tcp_splice_read); EXPORT_SYMBOL(tcp_splice_read);
struct sk_buff *tcp_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp, struct sk_buff *tcp_stream_alloc_skb(struct sock *sk, gfp_t gfp,
bool force_schedule) bool force_schedule)
{ {
struct sk_buff *skb; struct sk_buff *skb;
skb = alloc_skb_fclone(size + MAX_TCP_HEADER, gfp); skb = alloc_skb_fclone(MAX_TCP_HEADER, gfp);
if (likely(skb)) { if (likely(skb)) {
bool mem_scheduled; bool mem_scheduled;
...@@ -1178,7 +1178,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size) ...@@ -1178,7 +1178,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
goto restart; goto restart;
} }
first_skb = tcp_rtx_and_write_queues_empty(sk); first_skb = tcp_rtx_and_write_queues_empty(sk);
skb = tcp_stream_alloc_skb(sk, 0, sk->sk_allocation, skb = tcp_stream_alloc_skb(sk, sk->sk_allocation,
first_skb); first_skb);
if (!skb) if (!skb)
goto wait_for_space; goto wait_for_space;
......
...@@ -1558,7 +1558,7 @@ int tcp_fragment(struct sock *sk, enum tcp_queue tcp_queue, ...@@ -1558,7 +1558,7 @@ int tcp_fragment(struct sock *sk, enum tcp_queue tcp_queue,
return -ENOMEM; return -ENOMEM;
/* Get a new skb... force flag on. */ /* Get a new skb... force flag on. */
buff = tcp_stream_alloc_skb(sk, 0, gfp, true); buff = tcp_stream_alloc_skb(sk, gfp, true);
if (!buff) if (!buff)
return -ENOMEM; /* We'll just try again later. */ return -ENOMEM; /* We'll just try again later. */
skb_copy_decrypted(buff, skb); skb_copy_decrypted(buff, skb);
...@@ -2118,7 +2118,7 @@ static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len, ...@@ -2118,7 +2118,7 @@ static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len,
/* All of a TSO frame must be composed of paged data. */ /* All of a TSO frame must be composed of paged data. */
DEBUG_NET_WARN_ON_ONCE(skb->len != skb->data_len); DEBUG_NET_WARN_ON_ONCE(skb->len != skb->data_len);
buff = tcp_stream_alloc_skb(sk, 0, gfp, true); buff = tcp_stream_alloc_skb(sk, gfp, true);
if (unlikely(!buff)) if (unlikely(!buff))
return -ENOMEM; return -ENOMEM;
skb_copy_decrypted(buff, skb); skb_copy_decrypted(buff, skb);
...@@ -2434,7 +2434,7 @@ static int tcp_mtu_probe(struct sock *sk) ...@@ -2434,7 +2434,7 @@ static int tcp_mtu_probe(struct sock *sk)
return -1; return -1;
/* We're allowed to probe. Build it now. */ /* We're allowed to probe. Build it now. */
nskb = tcp_stream_alloc_skb(sk, 0, GFP_ATOMIC, false); nskb = tcp_stream_alloc_skb(sk, GFP_ATOMIC, false);
if (!nskb) if (!nskb)
return -1; return -1;
...@@ -3811,7 +3811,7 @@ static int tcp_send_syn_data(struct sock *sk, struct sk_buff *syn) ...@@ -3811,7 +3811,7 @@ static int tcp_send_syn_data(struct sock *sk, struct sk_buff *syn)
!skb_page_frag_refill(min_t(size_t, space, PAGE_SIZE), !skb_page_frag_refill(min_t(size_t, space, PAGE_SIZE),
pfrag, sk->sk_allocation)) pfrag, sk->sk_allocation))
goto fallback; goto fallback;
syn_data = tcp_stream_alloc_skb(sk, 0, sk->sk_allocation, false); syn_data = tcp_stream_alloc_skb(sk, sk->sk_allocation, false);
if (!syn_data) if (!syn_data)
goto fallback; goto fallback;
memcpy(syn_data->cb, syn->cb, sizeof(syn->cb)); memcpy(syn_data->cb, syn->cb, sizeof(syn->cb));
...@@ -3896,7 +3896,7 @@ int tcp_connect(struct sock *sk) ...@@ -3896,7 +3896,7 @@ int tcp_connect(struct sock *sk)
return 0; return 0;
} }
buff = tcp_stream_alloc_skb(sk, 0, sk->sk_allocation, true); buff = tcp_stream_alloc_skb(sk, sk->sk_allocation, true);
if (unlikely(!buff)) if (unlikely(!buff))
return -ENOBUFS; return -ENOBUFS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment