From: Stefan Metzmacher Date: Tue, 2 Sep 2025 10:42:51 +0000 (+0200) Subject: smb: smbdirect: introduce smbdirect_socket_wake_up_all() X-Git-Tag: v7.1-rc1~128^2~137 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=67ac123e026b8b98e6d2f3f7ba3706c32ecde019;p=thirdparty%2Fkernel%2Flinux.git smb: smbdirect: introduce smbdirect_socket_wake_up_all() 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 Cc: Tom Talpey Cc: Long Li Cc: Namjae Jeon 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/common/smbdirect/smbdirect_socket.c b/fs/smb/common/smbdirect/smbdirect_socket.c index 6c2732496cf73..30a4e973ce775 100644 --- a/fs/smb/common/smbdirect/smbdirect_socket.c +++ b/fs/smb/common/smbdirect/smbdirect_socket.c @@ -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); +}