mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-12 16:58:53 +00:00
tcp: remove TCP_OFF and TCP_PAGE macros
As mentioned by Joe Perches, TCP_OFF() and TCP_PAGE() macros are useless. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
b474ae7760
commit
0a5912db7b
@ -888,9 +888,6 @@ int tcp_sendpage(struct sock *sk, struct page *page, int offset,
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(tcp_sendpage);
|
EXPORT_SYMBOL(tcp_sendpage);
|
||||||
|
|
||||||
#define TCP_PAGE(sk) (sk->sk_sndmsg_page)
|
|
||||||
#define TCP_OFF(sk) (sk->sk_sndmsg_off)
|
|
||||||
|
|
||||||
static inline int select_size(const struct sock *sk, bool sg)
|
static inline int select_size(const struct sock *sk, bool sg)
|
||||||
{
|
{
|
||||||
const struct tcp_sock *tp = tcp_sk(sk);
|
const struct tcp_sock *tp = tcp_sk(sk);
|
||||||
@ -1008,13 +1005,13 @@ new_segment:
|
|||||||
} else {
|
} else {
|
||||||
int merge = 0;
|
int merge = 0;
|
||||||
int i = skb_shinfo(skb)->nr_frags;
|
int i = skb_shinfo(skb)->nr_frags;
|
||||||
struct page *page = TCP_PAGE(sk);
|
struct page *page = sk->sk_sndmsg_page;
|
||||||
int off;
|
int off;
|
||||||
|
|
||||||
if (page && page_count(page) == 1)
|
if (page && page_count(page) == 1)
|
||||||
TCP_OFF(sk) = 0;
|
sk->sk_sndmsg_off = 0;
|
||||||
|
|
||||||
off = TCP_OFF(sk);
|
off = sk->sk_sndmsg_off;
|
||||||
|
|
||||||
if (skb_can_coalesce(skb, i, page, off) &&
|
if (skb_can_coalesce(skb, i, page, off) &&
|
||||||
off != PAGE_SIZE) {
|
off != PAGE_SIZE) {
|
||||||
@ -1031,7 +1028,7 @@ new_segment:
|
|||||||
} else if (page) {
|
} else if (page) {
|
||||||
if (off == PAGE_SIZE) {
|
if (off == PAGE_SIZE) {
|
||||||
put_page(page);
|
put_page(page);
|
||||||
TCP_PAGE(sk) = page = NULL;
|
sk->sk_sndmsg_page = page = NULL;
|
||||||
off = 0;
|
off = 0;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
@ -1057,9 +1054,9 @@ new_segment:
|
|||||||
/* If this page was new, give it to the
|
/* If this page was new, give it to the
|
||||||
* socket so it does not get leaked.
|
* socket so it does not get leaked.
|
||||||
*/
|
*/
|
||||||
if (!TCP_PAGE(sk)) {
|
if (!sk->sk_sndmsg_page) {
|
||||||
TCP_PAGE(sk) = page;
|
sk->sk_sndmsg_page = page;
|
||||||
TCP_OFF(sk) = 0;
|
sk->sk_sndmsg_off = 0;
|
||||||
}
|
}
|
||||||
goto do_error;
|
goto do_error;
|
||||||
}
|
}
|
||||||
@ -1069,15 +1066,15 @@ new_segment:
|
|||||||
skb_frag_size_add(&skb_shinfo(skb)->frags[i - 1], copy);
|
skb_frag_size_add(&skb_shinfo(skb)->frags[i - 1], copy);
|
||||||
} else {
|
} else {
|
||||||
skb_fill_page_desc(skb, i, page, off, copy);
|
skb_fill_page_desc(skb, i, page, off, copy);
|
||||||
if (TCP_PAGE(sk)) {
|
if (sk->sk_sndmsg_page) {
|
||||||
get_page(page);
|
get_page(page);
|
||||||
} else if (off + copy < PAGE_SIZE) {
|
} else if (off + copy < PAGE_SIZE) {
|
||||||
get_page(page);
|
get_page(page);
|
||||||
TCP_PAGE(sk) = page;
|
sk->sk_sndmsg_page = page;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TCP_OFF(sk) = off + copy;
|
sk->sk_sndmsg_off = off + copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!copied)
|
if (!copied)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user