mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: menglong8.dong@gmail.com
To: pabeni@redhat.com
Cc: mptcp@lists.linux.dev, Menglong Dong <imagedong@tencent.com>,
	Jiang Biao <benbjiang@tencent.com>,
	Mengen Sun <mengensun@tencent.com>
Subject: [PATCH net v4 2/3] net: mptcp: move mptcp_cancel_work() to protocol.h
Date: Fri,  9 Sep 2022 13:49:31 +0800	[thread overview]
Message-ID: <20220909054932.246221-3-imagedong@tencent.com> (raw)
In-Reply-To: <20220909054932.246221-1-imagedong@tencent.com>

From: Menglong Dong <imagedong@tencent.com>

mptcp_cancel_work() is simple enough and we can make it as inline and
move it to protocol.h. mptcp_cancel_work() will be used in subflow.c
in the next commit.

Reviewed-by: Jiang Biao <benbjiang@tencent.com>
Reviewed-by: Mengen Sun <mengensun@tencent.com>
Signed-off-by: Menglong Dong <imagedong@tencent.com>
---
 net/mptcp/protocol.c | 8 --------
 net/mptcp/protocol.h | 8 ++++++++
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 1cfb4f1ff4e4..d6eb033e93b9 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2656,14 +2656,6 @@ static void __mptcp_clear_xmit(struct sock *sk)
 		dfrag_clear(sk, dfrag);
 }
 
-static void mptcp_cancel_work(struct sock *sk)
-{
-	struct mptcp_sock *msk = mptcp_sk(sk);
-
-	if (cancel_work_sync(&msk->work))
-		__sock_put(sk);
-}
-
 void mptcp_subflow_shutdown(struct sock *sk, struct sock *ssk, int how)
 {
 	lock_sock(ssk);
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 8f123d450c76..9de891373959 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -378,6 +378,14 @@ static inline struct mptcp_data_frag *mptcp_rtx_head(const struct sock *sk)
 	return list_first_entry_or_null(&msk->rtx_queue, struct mptcp_data_frag, list);
 }
 
+static inline void mptcp_cancel_work(struct sock *sk)
+{
+	struct mptcp_sock *msk = mptcp_sk(sk);
+
+	if (cancel_work_sync(&msk->work))
+		__sock_put(sk);
+}
+
 struct csum_pseudo_header {
 	__be64 data_seq;
 	__be32 subflow_seq;
-- 
2.37.2


  parent reply	other threads:[~2022-09-09  5:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09  5:49 [PATCH net v4 0/3] net: mptcp: fix unreleased socket in accept queue menglong8.dong
2022-09-09  5:49 ` [PATCH net v4 1/3] net: mptcp: factor out __mptcp_close() without socket lock menglong8.dong
2022-09-09  7:31   ` Paolo Abeni
2022-09-10  4:22     ` Menglong Dong
2022-09-09  5:49 ` menglong8.dong [this message]
2022-09-09  7:33   ` [PATCH net v4 2/3] net: mptcp: move mptcp_cancel_work() to protocol.h Paolo Abeni
2022-09-10  4:22     ` Menglong Dong
2022-09-09  5:49 ` [PATCH net v4 3/3] net: mptcp: fix unreleased socket in accept queue menglong8.dong
2022-09-09  7:40   ` Paolo Abeni

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=20220909054932.246221-3-imagedong@tencent.com \
    --to=menglong8.dong@gmail.com \
    --cc=benbjiang@tencent.com \
    --cc=imagedong@tencent.com \
    --cc=mengensun@tencent.com \
    --cc=mptcp@lists.linux.dev \
    --cc=pabeni@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).