From b3e78c651441eaf08e830e260d06fd8d33a8b7f9 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 21 Oct 2025 17:32:07 +0200 Subject: [PATCH] smb: smbdirect: introduce smbdirect_socket_shutdown() This can be used by client and server to trigger a disconnect of the connection, the idea of to be similar to kernel_sock_shutdown(), but for smbdirect there's no point in shutting down only one direction so there's no 'how' argument. 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 --- fs/smb/common/smbdirect/smbdirect_socket.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/smb/common/smbdirect/smbdirect_socket.c b/fs/smb/common/smbdirect/smbdirect_socket.c index 251d15219173..57b6e8e16183 100644 --- a/fs/smb/common/smbdirect/smbdirect_socket.c +++ b/fs/smb/common/smbdirect/smbdirect_socket.c @@ -385,6 +385,12 @@ static void smbdirect_socket_destroy_sync(struct smbdirect_socket *sc) SMBDIRECT_DEBUG_ERR_PTR(sc->first_error)); } +__maybe_unused /* this is temporary while this file is included in others */ +static void smbdirect_socket_shutdown(struct smbdirect_socket *sc) +{ + smbdirect_socket_schedule_cleanup_lvl(sc, SMBDIRECT_LOG_INFO, -ESHUTDOWN); +} + __maybe_unused /* this is temporary while this file is included in others */ static int smbdirect_socket_wait_for_credits(struct smbdirect_socket *sc, enum smbdirect_socket_status expected_status,