Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78218
b: refs/heads/master
c: df97c70
h: refs/heads/master
v: v3
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Jan 28, 2008
1 parent 618b32c commit 7f6e52a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f561d0f27d6283c49359bb96048f8ac3728c812c
refs/heads/master: df97c708d5e6eebdd9ded1fa588eae09acf53793
10 changes: 1 addition & 9 deletions trunk/include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -1192,15 +1192,7 @@ static inline void sk_stream_moderate_sndbuf(struct sock *sk)
}
}

struct sk_buff *sk_stream_alloc_pskb(struct sock *sk,
int size, int mem, gfp_t gfp);

static inline struct sk_buff *sk_stream_alloc_skb(struct sock *sk,
int size,
gfp_t gfp)
{
return sk_stream_alloc_pskb(sk, size, 0, gfp);
}
struct sk_buff *sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp);

static inline struct page *sk_stream_alloc_page(struct sock *sk)
{
Expand Down
11 changes: 4 additions & 7 deletions trunk/net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,7 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,
return ret;
}

struct sk_buff *sk_stream_alloc_pskb(struct sock *sk,
int size, int mem, gfp_t gfp)
struct sk_buff *sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp)
{
struct sk_buff *skb;

Expand All @@ -639,7 +638,6 @@ struct sk_buff *sk_stream_alloc_pskb(struct sock *sk,

skb = alloc_skb_fclone(size + sk->sk_prot->max_header, gfp);
if (skb) {
skb->truesize += mem;
if (sk_stream_wmem_schedule(sk, skb->truesize)) {
/*
* Make sure that we have exactly size bytes
Expand Down Expand Up @@ -692,8 +690,7 @@ static ssize_t do_tcp_sendpages(struct sock *sk, struct page **pages, int poffse
if (!sk_stream_memory_free(sk))
goto wait_for_sndbuf;

skb = sk_stream_alloc_pskb(sk, 0, 0,
sk->sk_allocation);
skb = sk_stream_alloc_skb(sk, 0, sk->sk_allocation);
if (!skb)
goto wait_for_memory;

Expand Down Expand Up @@ -873,8 +870,8 @@ int tcp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
if (!sk_stream_memory_free(sk))
goto wait_for_sndbuf;

skb = sk_stream_alloc_pskb(sk, select_size(sk),
0, sk->sk_allocation);
skb = sk_stream_alloc_skb(sk, select_size(sk),
sk->sk_allocation);
if (!skb)
goto wait_for_memory;

Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/tcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len,
if (skb->len != skb->data_len)
return tcp_fragment(sk, skb, len, mss_now);

buff = sk_stream_alloc_pskb(sk, 0, 0, GFP_ATOMIC);
buff = sk_stream_alloc_skb(sk, 0, GFP_ATOMIC);
if (unlikely(buff == NULL))
return -ENOMEM;

Expand Down

0 comments on commit 7f6e52a

Please sign in to comment.