]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
smb: client: add and use smbd_get_parameters()
authorStefan Metzmacher <metze@samba.org>
Thu, 21 Aug 2025 22:23:53 +0000 (00:23 +0200)
committerSteve French <stfrench@microsoft.com>
Sun, 28 Sep 2025 23:29:49 +0000 (18:29 -0500)
In future struct smbdirect_socket_parameters will be the only
public structure for the smb layer. This prepares this...

Cc: Steve French <smfrench@gmail.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Long Li <longli@microsoft.com>
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smb2ops.c
fs/smb/client/smbdirect.c
fs/smb/client/smbdirect.h

index e586f3f4b5c9378182db38be159d9564971010fa..4711a23c5b380dd06d0a2951fefcf08011b65d39 100644 (file)
@@ -504,8 +504,8 @@ smb3_negotiate_wsize(struct cifs_tcon *tcon, struct smb3_fs_context *ctx)
        wsize = min_t(unsigned int, wsize, server->max_write);
 #ifdef CONFIG_CIFS_SMB_DIRECT
        if (server->rdma) {
-               struct smbdirect_socket_parameters *sp =
-                       &server->smbd_conn->socket.parameters;
+               const struct smbdirect_socket_parameters *sp =
+                       smbd_get_parameters(server->smbd_conn);
 
                if (server->sign)
                        /*
@@ -555,8 +555,8 @@ smb3_negotiate_rsize(struct cifs_tcon *tcon, struct smb3_fs_context *ctx)
        rsize = min_t(unsigned int, rsize, server->max_read);
 #ifdef CONFIG_CIFS_SMB_DIRECT
        if (server->rdma) {
-               struct smbdirect_socket_parameters *sp =
-                       &server->smbd_conn->socket.parameters;
+               const struct smbdirect_socket_parameters *sp =
+                       smbd_get_parameters(server->smbd_conn);
 
                if (server->sign)
                        /*
index 9ea0383a3ae72786bb86e84da0a5eaedeae6ea58..3aa13771037587b0fe69031884a78c8d2d1765dd 100644 (file)
 #include "cifsproto.h"
 #include "smb2proto.h"
 
+const struct smbdirect_socket_parameters *smbd_get_parameters(struct smbd_connection *conn)
+{
+       struct smbdirect_socket *sc = &conn->socket;
+
+       return &sc->parameters;
+}
+
 static struct smbdirect_recv_io *get_receive_buffer(
                struct smbd_connection *info);
 static void put_receive_buffer(
index 455618e676f51a642ade0e2c1c669ff9720fa966..7773939db5f2c0f43fc7e16abc4c494ab3edeb7e 100644 (file)
@@ -59,6 +59,8 @@ struct smbd_connection {
 struct smbd_connection *smbd_get_connection(
        struct TCP_Server_Info *server, struct sockaddr *dstaddr);
 
+const struct smbdirect_socket_parameters *smbd_get_parameters(struct smbd_connection *conn);
+
 /* Reconnect SMBDirect session */
 int smbd_reconnect(struct TCP_Server_Info *server);
 /* Destroy SMBDirect session */