]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
smb: smbdirect: introduce smbdirect_socket_bind()
authorStefan Metzmacher <metze@samba.org>
Wed, 19 Nov 2025 13:56:03 +0000 (14:56 +0100)
committerSteve French <stfrench@microsoft.com>
Thu, 16 Apr 2026 02:58:20 +0000 (21:58 -0500)
This will be used by the server in the next steps.

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_public.h
fs/smb/common/smbdirect/smbdirect_socket.c

index 3d20d9a87e7ba10220b2c7f64730a4316705592c..95837beeece8faf7ff5b4e55a19b6ce7492f442b 100644 (file)
@@ -85,6 +85,9 @@ bool smbdirect_connection_is_connected(struct smbdirect_socket *sc);
 __SMBDIRECT_PUBLIC__
 int smbdirect_connection_wait_for_connected(struct smbdirect_socket *sc);
 
+__SMBDIRECT_PUBLIC__
+int smbdirect_socket_bind(struct smbdirect_socket *sc, struct sockaddr *addr);
+
 __SMBDIRECT_PUBLIC__
 void smbdirect_socket_shutdown(struct smbdirect_socket *sc);
 
index ac75860e4dd6499d1c568578d4e8cae34bbb6d31..def67fdac066e20bc853fcead5cfa2eae7e00f6a 100644 (file)
@@ -611,6 +611,22 @@ void smbdirect_socket_destroy_sync(struct smbdirect_socket *sc)
                SMBDIRECT_DEBUG_ERR_PTR(sc->first_error));
 }
 
+__SMBDIRECT_PUBLIC__
+int smbdirect_socket_bind(struct smbdirect_socket *sc, struct sockaddr *addr)
+{
+       int ret;
+
+       if (sc->status != SMBDIRECT_SOCKET_CREATED)
+               return -EINVAL;
+
+       ret = rdma_bind_addr(sc->rdma.cm_id, addr);
+       if (ret)
+               return ret;
+
+       return 0;
+}
+__SMBDIRECT_EXPORT_SYMBOL__(smbdirect_socket_bind);
+
 __SMBDIRECT_PUBLIC__
 void smbdirect_socket_shutdown(struct smbdirect_socket *sc)
 {