From: Stefan Metzmacher Date: Fri, 8 Aug 2025 17:06:49 +0000 (+0200) Subject: smb: client: make use of smbdirect_socket.disconnect_work X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a51c67db2c9e3f1539f5c441d8db2058ed8644f9;p=thirdparty%2Fkernel%2Fstable.git smb: client: make use of smbdirect_socket.disconnect_work Cc: Steve French Cc: Tom Talpey Cc: Long Li Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org Acked-by: Namjae Jeon Signed-off-by: Stefan Metzmacher Signed-off-by: Steve French --- diff --git a/fs/smb/client/smbdirect.c b/fs/smb/client/smbdirect.c index fcef8f879bb36..89375f3bd30a0 100644 --- a/fs/smb/client/smbdirect.c +++ b/fs/smb/client/smbdirect.c @@ -157,9 +157,8 @@ do { \ static void smbd_disconnect_rdma_work(struct work_struct *work) { - struct smbd_connection *info = - container_of(work, struct smbd_connection, disconnect_work); - struct smbdirect_socket *sc = &info->socket; + struct smbdirect_socket *sc = + container_of(work, struct smbdirect_socket, disconnect_work); switch (sc->status) { case SMBDIRECT_SOCKET_NEGOTIATE_NEEDED: @@ -197,7 +196,9 @@ static void smbd_disconnect_rdma_work(struct work_struct *work) static void smbd_disconnect_rdma_connection(struct smbd_connection *info) { - queue_work(info->workqueue, &info->disconnect_work); + struct smbdirect_socket *sc = &info->socket; + + queue_work(info->workqueue, &sc->disconnect_work); } /* Upcall from RDMA CM */ @@ -1705,6 +1706,8 @@ static struct smbd_connection *_smbd_get_connection( info->initiator_depth = 1; info->responder_resources = SMBD_CM_RESPONDER_RESOURCES; + INIT_WORK(&sc->disconnect_work, smbd_disconnect_rdma_work); + rc = smbd_ia_open(info, dstaddr, port); if (rc) { log_rdma_event(INFO, "smbd_ia_open rc=%d\n", rc); @@ -1850,7 +1853,6 @@ static struct smbd_connection *_smbd_get_connection( init_waitqueue_head(&info->wait_post_send); - INIT_WORK(&info->disconnect_work, smbd_disconnect_rdma_work); INIT_WORK(&info->post_send_credits_work, smbd_post_send_credits); info->new_credits_offered = 0; spin_lock_init(&info->lock_new_credits_offered); diff --git a/fs/smb/client/smbdirect.h b/fs/smb/client/smbdirect.h index f250241d2d24b..1c63188664df9 100644 --- a/fs/smb/client/smbdirect.h +++ b/fs/smb/client/smbdirect.h @@ -45,7 +45,6 @@ enum keep_alive_status { struct smbd_connection { struct smbdirect_socket socket; - struct work_struct disconnect_work; struct work_struct post_send_credits_work; spinlock_t lock_new_credits_offered;