]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
smb: smbdirect: introduce smbdirect_socket_wake_up_all()
authorStefan Metzmacher <metze@samba.org>
Tue, 2 Sep 2025 10:42:51 +0000 (12:42 +0200)
committerSteve French <stfrench@microsoft.com>
Thu, 16 Apr 2026 02:58:18 +0000 (21:58 -0500)
This is a superset of smbd_disconnect_wake_up_all() in the client
and smb_direct_disconnect_wake_up_all() in the server and will
replace them.

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/common/smbdirect/smbdirect_socket.c

index 6c2732496cf7335371f1406a2409a6267b91c8db..30a4e973ce775c730b99a6a0063729a9afebba21 100644 (file)
@@ -44,3 +44,22 @@ static void smbdirect_socket_set_logging(struct smbdirect_socket *sc,
        sc->logging.needed = needed;
        sc->logging.vaprintf = vaprintf;
 }
+
+__maybe_unused /* this is temporary while this file is included in others */
+static void smbdirect_socket_wake_up_all(struct smbdirect_socket *sc)
+{
+       /*
+        * Wake up all waiters in all wait queues
+        * in order to notice the broken connection.
+        */
+       wake_up_all(&sc->status_wait);
+       wake_up_all(&sc->send_io.bcredits.wait_queue);
+       wake_up_all(&sc->send_io.lcredits.wait_queue);
+       wake_up_all(&sc->send_io.credits.wait_queue);
+       wake_up_all(&sc->send_io.pending.dec_wait_queue);
+       wake_up_all(&sc->send_io.pending.zero_wait_queue);
+       wake_up_all(&sc->recv_io.reassembly.wait_queue);
+       wake_up_all(&sc->rw_io.credits.wait_queue);
+       wake_up_all(&sc->mr_io.ready.wait_queue);
+       wake_up_all(&sc->mr_io.cleanup.wait_queue);
+}