]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
smb: server: make use of smbdirect_connection_idle_timer_work()
authorStefan Metzmacher <metze@samba.org>
Wed, 27 Aug 2025 15:25:37 +0000 (17:25 +0200)
committerSteve French <stfrench@microsoft.com>
Thu, 16 Apr 2026 02:58:22 +0000 (21:58 -0500)
This is basically a copy of smb_direct_idle_connection_timer().
The only difference is that we had no logging before.

Note smbdirect_socket_prepare_create() already calls INIT_DELAYED_WORK().

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 bb92000aa338f572fb772c74fbccf32245939d8f..1606fc70810e373e86500697a8881fb59dfc46f5 100644 (file)
@@ -239,30 +239,6 @@ static void smb_direct_send_immediate_work(struct work_struct *work)
        smb_direct_post_send_data(sc, NULL, NULL, 0, 0);
 }
 
-static void smb_direct_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) {
-               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));
-       queue_work(sc->workqueue, &sc->idle.immediate_work);
-}
-
 static struct smb_direct_transport *alloc_transport(struct rdma_cm_id *cm_id)
 {
        struct smb_direct_transport *t;
@@ -305,8 +281,6 @@ static struct smb_direct_transport *alloc_transport(struct rdma_cm_id *cm_id)
 
        sc->ib.dev = sc->rdma.cm_id->device;
 
-       INIT_DELAYED_WORK(&sc->idle.timer_work, smb_direct_idle_connection_timer);
-
        conn = ksmbd_conn_alloc();
        if (!conn)
                goto err;