]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
smb: client: pass struct smbdirect_socket to smbd_post_recv()
authorStefan Metzmacher <metze@samba.org>
Fri, 22 Aug 2025 08:14:29 +0000 (10:14 +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 9c2fb138ce1f41e222b7caa5857ff1a23715c9c5..809c529b1b3c158b4dc72af1be19ba5bc4c6b6d7 100644 (file)
@@ -35,7 +35,7 @@ static struct smbdirect_recv_io *_get_first_reassembly(
                struct smbdirect_socket *sc);
 
 static int smbd_post_recv(
-               struct smbd_connection *info,
+               struct smbdirect_socket *sc,
                struct smbdirect_recv_io *response);
 
 static int smbd_post_send_empty(struct smbd_connection *info);
@@ -535,8 +535,6 @@ static void smbd_post_send_credits(struct work_struct *work)
        struct smbdirect_recv_io *response;
        struct smbdirect_socket *sc =
                container_of(work, struct smbdirect_socket, recv_io.posted.refill_work);
-       struct smbd_connection *info =
-               container_of(sc, struct smbd_connection, socket);
 
        if (sc->status != SMBDIRECT_SOCKET_CONNECTED) {
                return;
@@ -550,7 +548,7 @@ static void smbd_post_send_credits(struct work_struct *work)
                                break;
 
                        response->first_segment = false;
-                       rc = smbd_post_recv(info, response);
+                       rc = smbd_post_recv(sc, response);
                        if (rc) {
                                log_rdma_recv(ERR,
                                        "post_recv failed rc=%d\n", rc);
@@ -1241,9 +1239,8 @@ static int smbd_post_send_full_iter(struct smbd_connection *info,
  * The interaction is controlled by send/receive credit system
  */
 static int smbd_post_recv(
-               struct smbd_connection *info, struct smbdirect_recv_io *response)
+               struct smbdirect_socket *sc, struct smbdirect_recv_io *response)
 {
-       struct smbdirect_socket *sc = &info->socket;
        struct smbdirect_socket_parameters *sp = &sc->parameters;
        struct ib_recv_wr recv_wr;
        int rc = -EIO;
@@ -1288,7 +1285,7 @@ static int smbd_negotiate(struct smbd_connection *info)
        sc->status = SMBDIRECT_SOCKET_NEGOTIATE_RUNNING;
 
        sc->recv_io.expected = SMBDIRECT_EXPECT_NEGOTIATE_REP;
-       rc = smbd_post_recv(info, response);
+       rc = smbd_post_recv(sc, response);
        log_rdma_event(INFO, "smbd_post_recv rc=%d iov.addr=0x%llx iov.length=%u iov.lkey=0x%x\n",
                       rc, response->sge.addr,
                       response->sge.length, response->sge.lkey);