mptcp: use msk instead of mptcp_sk
authorGeliang Tang <geliang.tang@suse.com>
Thu, 10 Nov 2022 23:23:18 +0000 (15:23 -0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 12 Nov 2022 05:19:46 +0000 (21:19 -0800)
Use msk instead of mptcp_sk(sk) in the functions where the variable
"msk = mptcp_sk(sk)" has been defined.

Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/protocol.c

index 109eea2c65ff7fb75330f5322714c92595520e7d..64d7070de901b8317b58f0b9482b75a5fcc0fa64 100644 (file)
@@ -1625,7 +1625,7 @@ static void __mptcp_subflow_push_pending(struct sock *sk, struct sock *ssk)
                         * check for a different subflow usage only after
                         * spooling the first chunk of data
                         */
-                       xmit_ssk = first ? ssk : mptcp_subflow_get_send(mptcp_sk(sk));
+                       xmit_ssk = first ? ssk : mptcp_subflow_get_send(msk);
                        if (!xmit_ssk)
                                goto out;
                        if (xmit_ssk != ssk) {
@@ -2275,7 +2275,7 @@ bool __mptcp_retransmit_pending_data(struct sock *sk)
        struct mptcp_data_frag *cur, *rtx_head;
        struct mptcp_sock *msk = mptcp_sk(sk);
 
-       if (__mptcp_check_fallback(mptcp_sk(sk)))
+       if (__mptcp_check_fallback(msk))
                return false;
 
        if (tcp_rtx_and_write_queues_empty(sk))
@@ -2949,7 +2949,7 @@ cleanup:
 
        sock_hold(sk);
        pr_debug("msk=%p state=%d", sk, sk->sk_state);
-       if (mptcp_sk(sk)->token)
+       if (msk->token)
                mptcp_event(MPTCP_EVENT_CLOSED, msk, NULL, GFP_KERNEL);
 
        if (sk->sk_state == TCP_CLOSE) {
@@ -3008,8 +3008,8 @@ static int mptcp_disconnect(struct sock *sk, int flags)
        mptcp_stop_timer(sk);
        sk_stop_timer(sk, &sk->sk_timer);
 
-       if (mptcp_sk(sk)->token)
-               mptcp_event(MPTCP_EVENT_CLOSED, mptcp_sk(sk), NULL, GFP_KERNEL);
+       if (msk->token)
+               mptcp_event(MPTCP_EVENT_CLOSED, msk, NULL, GFP_KERNEL);
 
        /* msk->subflow is still intact, the following will not free the first
         * subflow