aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-12-04 20:07:15 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-05 18:30:03 -0500
commit0a5912db7b4f9c3ff3bd0dbb67f36484a3b21a35 (patch)
tree7613fdb0ea204f9b55662d850bb83a722fb89532 /net/ipv4/tcp.c
parentb474ae77609b725098d5a7cc8f69c1c528710d53 (diff)
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>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index a09fe253b917..43dfccce62e9 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -888,9 +888,6 @@ int tcp_sendpage(struct sock *sk, struct page *page, int offset,
888} 888}
889EXPORT_SYMBOL(tcp_sendpage); 889EXPORT_SYMBOL(tcp_sendpage);
890 890
891#define TCP_PAGE(sk) (sk->sk_sndmsg_page)
892#define TCP_OFF(sk) (sk->sk_sndmsg_off)
893
894static inline int select_size(const struct sock *sk, bool sg) 891static inline int select_size(const struct sock *sk, bool sg)
895{ 892{
896 const struct tcp_sock *tp = tcp_sk(sk); 893 const struct tcp_sock *tp = tcp_sk(sk);
@@ -1008,13 +1005,13 @@ new_segment:
1008 } else { 1005 } else {
1009 int merge = 0; 1006 int merge = 0;
1010 int i = skb_shinfo(skb)->nr_frags; 1007 int i = skb_shinfo(skb)->nr_frags;
1011 struct page *page = TCP_PAGE(sk); 1008 struct page *page = sk->sk_sndmsg_page;
1012 int off; 1009 int off;
1013 1010
1014 if (page && page_count(page) == 1) 1011 if (page && page_count(page) == 1)
1015 TCP_OFF(sk) = 0; 1012 sk->sk_sndmsg_off = 0;
1016 1013
1017 off = TCP_OFF(sk); 1014 off = sk->sk_sndmsg_off;
1018 1015
1019 if (skb_can_coalesce(skb, i, page, off) && 1016 if (skb_can_coalesce(skb, i, page, off) &&
1020 off != PAGE_SIZE) { 1017 off != PAGE_SIZE) {
@@ -1031,7 +1028,7 @@ new_segment:
1031 } else if (page) { 1028 } else if (page) {
1032 if (off == PAGE_SIZE) { 1029 if (off == PAGE_SIZE) {
1033 put_page(page); 1030 put_page(page);
1034 TCP_PAGE(sk) = page = NULL; 1031 sk->sk_sndmsg_page = page = NULL;
1035 off = 0; 1032 off = 0;
1036 } 1033 }
1037 } else 1034 } else
@@ -1057,9 +1054,9 @@ new_segment:
1057 /* If this page was new, give it to the 1054 /* If this page was new, give it to the
1058 * socket so it does not get leaked. 1055 * socket so it does not get leaked.
1059 */ 1056 */
1060 if (!TCP_PAGE(sk)) { 1057 if (!sk->sk_sndmsg_page) {
1061 TCP_PAGE(sk) = page; 1058 sk->sk_sndmsg_page = page;
1062 TCP_OFF(sk) = 0; 1059 sk->sk_sndmsg_off = 0;
1063 } 1060 }
1064 goto do_error; 1061 goto do_error;
1065 } 1062 }
@@ -1069,15 +1066,15 @@ new_segment:
1069 skb_frag_size_add(&skb_shinfo(skb)->frags[i - 1], copy); 1066 skb_frag_size_add(&skb_shinfo(skb)->frags[i - 1], copy);
1070 } else { 1067 } else {
1071 skb_fill_page_desc(skb, i, page, off, copy); 1068 skb_fill_page_desc(skb, i, page, off, copy);
1072 if (TCP_PAGE(sk)) { 1069 if (sk->sk_sndmsg_page) {
1073 get_page(page); 1070 get_page(page);
1074 } else if (off + copy < PAGE_SIZE) { 1071 } else if (off + copy < PAGE_SIZE) {
1075 get_page(page); 1072 get_page(page);
1076 TCP_PAGE(sk) = page; 1073 sk->sk_sndmsg_page = page;
1077 } 1074 }
1078 } 1075 }
1079 1076
1080 TCP_OFF(sk) = off + copy; 1077 sk->sk_sndmsg_off = off + copy;
1081 } 1078 }
1082 1079
1083 if (!copied) 1080 if (!copied)