From: Stefan Metzmacher Date: Wed, 27 Aug 2025 15:25:37 +0000 (+0200) Subject: smb: server: make use of smbdirect_connection_idle_timer_work() X-Git-Tag: v7.1-rc1~128^2~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84d7085e5f2343877e4b0e0a55569f59f7db92a1;p=thirdparty%2Fkernel%2Flinux.git smb: server: make use of smbdirect_connection_idle_timer_work() 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 Cc: Steve French Cc: Tom Talpey Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org Signed-off-by: Stefan Metzmacher Acked-by: Namjae Jeon Signed-off-by: Steve French --- diff --git a/fs/smb/server/transport_rdma.c b/fs/smb/server/transport_rdma.c index bb92000aa338f..1606fc70810e3 100644 --- a/fs/smb/server/transport_rdma.c +++ b/fs/smb/server/transport_rdma.c @@ -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;