[PATCH v2 047/127] smb: smbdirect: introduce smbdirect_connection_is_connected()
Stefan Metzmacher
metze at samba.org
Wed Oct 29 13:20:25 UTC 2025
This is a simple way to check is the connection is still ok
without the need to know internals of struct smbdirect_socket.
Cc: Steve French <smfrench at gmail.com>
Cc: Tom Talpey <tom at talpey.com>
Cc: Long Li <longli at microsoft.com>
Cc: Namjae Jeon <linkinjeon at kernel.org>
Cc: linux-cifs at vger.kernel.org
Cc: samba-technical at lists.samba.org
Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
fs/smb/common/smbdirect/smbdirect_connection.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/fs/smb/common/smbdirect/smbdirect_connection.c b/fs/smb/common/smbdirect/smbdirect_connection.c
index 858b071ba1bb..1487efbe7620 100644
--- a/fs/smb/common/smbdirect/smbdirect_connection.c
+++ b/fs/smb/common/smbdirect/smbdirect_connection.c
@@ -900,6 +900,14 @@ static void smbdirect_connection_disconnect_work(struct work_struct *work)
smbdirect_connection_wake_up_all(sc);
}
+__maybe_unused /* this is temporary while this file is included in orders */
+static bool smbdirect_connection_is_connected(struct smbdirect_socket *sc)
+{
+ if (unlikely(!sc || sc->first_error || sc->status != SMBDIRECT_SOCKET_CONNECTED))
+ return false;
+ return true;
+}
+
__maybe_unused /* this is temporary while this file is included in orders */
static int smbdirect_connection_wait_for_connected(struct smbdirect_socket *sc)
{
--
2.43.0
More information about the samba-technical
mailing list