From: Geliang Tang <tanggeliang@kylinos.cn>
This patch moves mptcp_pm_close_subflow() forward to let it be used by both
the userspace PM and the in-kernel PM in mptcp_pm_subflow_check_next().
Then mptcp_pm_is_userspace() here can be dropped.
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
net/mptcp/pm.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index 39842f7786db..9904fb71d596 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -551,22 +551,14 @@ void mptcp_pm_subflow_check_next(struct mptcp_sock *msk,
bool update_subflows;
update_subflows = subflow->request_join || subflow->mp_join;
- if (mptcp_pm_is_userspace(msk)) {
- if (update_subflows) {
- spin_lock_bh(&pm->lock);
- pm->subflows--;
- spin_unlock_bh(&pm->lock);
- }
- return;
- }
+ if (update_subflows)
+ mptcp_pm_close_subflow(msk);
if (!pm->ops->subflow_established ||
- (!READ_ONCE(pm->work_pending) && !update_subflows))
+ !READ_ONCE(pm->work_pending))
return;
spin_lock_bh(&pm->lock);
- if (update_subflows)
- __mptcp_pm_close_subflow(msk);
/* Even if this subflow is not really established, tell the PM to try
* to pick the next ones, if possible.
--
2.43.0