All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: mptcp@lists.linux.dev
Subject: [PATCH mptcp-next 3/3] tcp: make tcp_build_frag() static
Date: Mon, 20 Sep 2021 19:24:29 +0200	[thread overview]
Message-ID: <1949660e9af338adc8913b7cdf8c632401d6d6e0.1632158356.git.pabeni@redhat.com> (raw)
In-Reply-To: <cover.1632158356.git.pabeni@redhat.com>

After the previous patch the mentioned helper is
used only inside its compilation unit: let's make
it static.

RFC -> v1:
 - preserve the tcp_build_frag() helper (Eric)

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
Note:
this should _replace_:
"""
Partially revert "tcp: factor out tcp_build_frag()"
"""

I did not opted for a squash to patch, as it would
still require conflicts resolution after the previous
squash-to patch. @matttbe: please let me know if you
prefer otherwise.
---
 include/net/tcp.h | 2 --
 net/ipv4/tcp.c    | 5 ++---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index 4a96f6e0f6f8..673c3b01e287 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -330,8 +330,6 @@ int tcp_sendpage(struct sock *sk, struct page *page, int offset, size_t size,
 		 int flags);
 int tcp_sendpage_locked(struct sock *sk, struct page *page, int offset,
 			size_t size, int flags);
-struct sk_buff *tcp_build_frag(struct sock *sk, int size_goal, int flags,
-			       struct page *page, int offset, size_t *size);
 ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset,
 		 size_t size, int flags);
 int tcp_send_mss(struct sock *sk, int *size_goal, int flags);
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index c592454625e1..4ae43222d71f 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -963,8 +963,8 @@ void tcp_remove_empty_skb(struct sock *sk, struct sk_buff *skb)
 	}
 }
 
-struct sk_buff *tcp_build_frag(struct sock *sk, int size_goal, int flags,
-			       struct page *page, int offset, size_t *size)
+static struct sk_buff *tcp_build_frag(struct sock *sk, int size_goal, int flags,
+				      struct page *page, int offset, size_t *size)
 {
 	struct sk_buff *skb = tcp_write_queue_tail(sk);
 	struct tcp_sock *tp = tcp_sk(sk);
@@ -1064,7 +1064,6 @@ ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset,
 		size_t copy = size;
 
 		skb = tcp_build_frag(sk, size_goal, flags, page, offset, &copy);
-		if (!skb)
 			goto wait_for_space;
 
 		if (!copied)
-- 
2.26.3


  parent reply	other threads:[~2021-09-20 17:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20 17:24 [PATCH mptcp-next 0/3] mptcp: tx refactor update Paolo Abeni
2021-09-20 17:24 ` [PATCH mptcp-next 1/3] Squash-to: "tcp: expose the tcp_mark_push() and skb_entail() helpers" Paolo Abeni
2021-09-20 17:24 ` [PATCH mptcp-next 2/3] Squash-to: "mptcp: stop relying on tcp_tx_skb_cache" Paolo Abeni
2021-09-20 17:24 ` Paolo Abeni [this message]
2021-09-20 22:02   ` [PATCH mptcp-next 3/3] tcp: make tcp_build_frag() static Mat Martineau
2021-09-21  9:44     ` Paolo Abeni
2021-09-20 22:04 ` [PATCH mptcp-next 0/3] mptcp: tx refactor update Mat Martineau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1949660e9af338adc8913b7cdf8c632401d6d6e0.1632158356.git.pabeni@redhat.com \
    --to=pabeni@redhat.com \
    --cc=mptcp@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.