]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
smb: client: make use of smbdirect_connection_idle_timer_work()
authorStefan Metzmacher <metze@samba.org>
Wed, 27 Aug 2025 15:22:44 +0000 (17:22 +0200)
committerSteve French <stfrench@microsoft.com>
Thu, 16 Apr 2026 02:58:21 +0000 (21:58 -0500)
This is basically a copy of idle_connection_timer().

Note smbdirect_socket_prepare_create() already calls INIT_DELAYED_WORK().

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>
fs/smb/client/smbdirect.c

index c65bcd8198165827bf06bdbdb386ea0873b7fbe1..8fa9621d3f231ddb46eabf5e8f7d4e954b1df6b3 100644 (file)
@@ -1649,35 +1649,6 @@ static void send_immediate_empty_message(struct work_struct *work)
        smbd_post_send_empty(sc);
 }
 
-/* Implement idle connection timer [MS-SMBD] 3.1.6.2 */
-static void idle_connection_timer(struct work_struct *work)
-{
-       struct smbdirect_socket *sc =
-               container_of(work, struct smbdirect_socket, idle.timer_work.work);
-       struct smbdirect_socket_parameters *sp = &sc->parameters;
-
-       if (sc->idle.keepalive != SMBDIRECT_KEEPALIVE_NONE) {
-               log_keep_alive(ERR,
-                       "error status sc->idle.keepalive=%d\n",
-                       sc->idle.keepalive);
-               smbdirect_socket_schedule_cleanup(sc, -ETIMEDOUT);
-               return;
-       }
-
-       if (sc->status != SMBDIRECT_SOCKET_CONNECTED)
-               return;
-
-       /*
-        * Now use the keepalive timeout (instead of keepalive interval)
-        * in order to wait for a response
-        */
-       sc->idle.keepalive = SMBDIRECT_KEEPALIVE_PENDING;
-       mod_delayed_work(sc->workqueue, &sc->idle.timer_work,
-                        msecs_to_jiffies(sp->keepalive_timeout_msec));
-       log_keep_alive(INFO, "schedule send of empty idle message\n");
-       queue_work(sc->workqueue, &sc->idle.immediate_work);
-}
-
 /*
  * Destroy the transport and related RDMA and memory resources
  * Need to go through all the pending counters and make sure on one is using
@@ -2081,7 +2052,6 @@ static struct smbd_connection *_smbd_get_connection(
        }
 
        INIT_WORK(&sc->idle.immediate_work, send_immediate_empty_message);
-       INIT_DELAYED_WORK(&sc->idle.timer_work, idle_connection_timer);
        /*
         * start with the negotiate timeout and SMBDIRECT_KEEPALIVE_PENDING
         * so that the timer will cause a disconnect.