]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
smb: client: pass struct smbdirect_socket to {allocate,destroy}_mr_list()
authorStefan Metzmacher <metze@samba.org>
Fri, 22 Aug 2025 08:10:10 +0000 (10:10 +0200)
committerSteve French <stfrench@microsoft.com>
Sun, 28 Sep 2025 23:29:50 +0000 (18:29 -0500)
This will make it easier to move function to the common code
in future.

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/smbdirect.c

index 8e354d10038a0a64929a3cafccff4fe5a75933ad..de0ac75b975b385e47d5139d9667a3085baad578 100644 (file)
@@ -40,8 +40,8 @@ static int smbd_post_recv(
 
 static int smbd_post_send_empty(struct smbd_connection *info);
 
-static void destroy_mr_list(struct smbd_connection *info);
-static int allocate_mr_list(struct smbd_connection *info);
+static void destroy_mr_list(struct smbdirect_socket *sc);
+static int allocate_mr_list(struct smbdirect_socket *sc);
 
 struct smb_extract_to_rdma {
        struct ib_sge           *sge;
@@ -1582,7 +1582,7 @@ void smbd_destroy(struct TCP_Server_Info *server)
                msleep(1000);
                cifs_server_lock(server);
        }
-       destroy_mr_list(info);
+       destroy_mr_list(sc);
 
        ib_free_cq(sc->ib.send_cq);
        ib_free_cq(sc->ib.recv_cq);
@@ -1907,7 +1907,7 @@ static struct smbd_connection *_smbd_get_connection(
                goto negotiation_failed;
        }
 
-       rc = allocate_mr_list(info);
+       rc = allocate_mr_list(sc);
        if (rc) {
                log_rdma_mr(ERR, "memory registration allocation failed\n");
                goto allocate_mr_failed;
@@ -2289,9 +2289,8 @@ static void smbd_mr_recovery_work(struct work_struct *work)
        }
 }
 
-static void destroy_mr_list(struct smbd_connection *info)
+static void destroy_mr_list(struct smbdirect_socket *sc)
 {
-       struct smbdirect_socket *sc = &info->socket;
        struct smbdirect_mr_io *mr, *tmp;
 
        disable_work_sync(&sc->mr_io.recovery_work);
@@ -2312,9 +2311,8 @@ static void destroy_mr_list(struct smbd_connection *info)
  * Recovery is done in smbd_mr_recovery_work. The content of list entry changes
  * as MRs are used and recovered for I/O, but the list links will not change
  */
-static int allocate_mr_list(struct smbd_connection *info)
+static int allocate_mr_list(struct smbdirect_socket *sc)
 {
-       struct smbdirect_socket *sc = &info->socket;
        struct smbdirect_socket_parameters *sp = &sc->parameters;
        int i;
        struct smbdirect_mr_io *smbdirect_mr, *tmp;