]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
smb: server: make use of smbdirect_connection_request_keep_alive()
authorStefan Metzmacher <metze@samba.org>
Fri, 17 Oct 2025 13:53:04 +0000 (15:53 +0200)
committerSteve French <stfrench@microsoft.com>
Thu, 16 Apr 2026 02:58:23 +0000 (21:58 -0500)
This will help to share more common code soon.

Cc: Namjae Jeon <linkinjeon@kernel.org>
Cc: Steve French <smfrench@gmail.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/server/transport_rdma.c

index 278dca91248598b585a5e776f2c3b8b82d9492df..c3d4ce423db3d83e9fcad3b86d73d417a80fe4c7 100644 (file)
@@ -618,23 +618,6 @@ static int smb_direct_read(struct ksmbd_transport *t, char *buf,
        return ret;
 }
 
-static int manage_keep_alive_before_sending(struct smbdirect_socket *sc)
-{
-       struct smbdirect_socket_parameters *sp = &sc->parameters;
-
-       if (sc->idle.keepalive == SMBDIRECT_KEEPALIVE_PENDING) {
-               sc->idle.keepalive = SMBDIRECT_KEEPALIVE_SENT;
-               /*
-                * Now use the keepalive timeout (instead of keepalive interval)
-                * in order to wait for a response
-                */
-               mod_delayed_work(sc->workqueue, &sc->idle.timer_work,
-                                msecs_to_jiffies(sp->keepalive_timeout_msec));
-               return 1;
-       }
-       return 0;
-}
-
 static int smb_direct_post_send(struct smbdirect_socket *sc,
                                struct ib_send_wr *wr)
 {
@@ -802,7 +785,7 @@ static int smb_direct_create_header(struct smbdirect_socket *sc,
        packet->credits_granted = cpu_to_le16(new_credits);
 
        packet->flags = 0;
-       if (manage_keep_alive_before_sending(sc))
+       if (smbdirect_connection_request_keep_alive(sc))
                packet->flags |= cpu_to_le16(SMBDIRECT_FLAG_RESPONSE_REQUESTED);
 
        packet->reserved = 0;