summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2025-10-17 16:51:26 +0300
committerSteve French <stfrench@microsoft.com>2026-04-16 05:58:22 +0300
commitb942f351c25051f971a39fac06ebed02da9a648e (patch)
tree4146849a801a417145b2718297c80be388c047a3
parent8b72c199a9626cc1b53c8d579e9e4c6f23af8908 (diff)
downloadlinux-b942f351c25051f971a39fac06ebed02da9a648e.tar.xz
smb: client: make use of smbdirect_connection_request_keep_alive()
This will help to share more common code soon. Cc: Steve French <smfrench@gmail.com> Cc: Tom Talpey <tom@talpey.com> Cc: Long Li <longli@microsoft.com> Cc: Namjae Jeon <linkinjeon@kernel.org> 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>
-rw-r--r--fs/smb/client/smbdirect.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/fs/smb/client/smbdirect.c b/fs/smb/client/smbdirect.c
index 4cc5dc825ee4..2464e0617eec 100644
--- a/fs/smb/client/smbdirect.c
+++ b/fs/smb/client/smbdirect.c
@@ -759,32 +759,6 @@ dma_mapping_failed:
return rc;
}
-/*
- * Check if we need to send a KEEP_ALIVE message
- * The idle connection timer triggers a KEEP_ALIVE message when expires
- * SMBDIRECT_FLAG_RESPONSE_REQUESTED is set in the message flag to have peer send
- * back a response.
- * return value:
- * 1 if SMBDIRECT_FLAG_RESPONSE_REQUESTED needs to be set
- * 0: otherwise
- */
-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 smbd_ib_post_send(struct smbdirect_socket *sc,
struct ib_send_wr *wr)
{
@@ -1108,7 +1082,7 @@ static int smbd_post_send_iter(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;