smb: client: initialize recv_io->cqe.done = recv_done just once

smbdirect_recv_io structures are pre-allocated so we can set the
callback function just once.

This will make it easy to move smbd_post_recv() to common code
soon.

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>
This commit is contained in:
Stefan Metzmacher 2025-09-17 08:54:03 +02:00 committed by Steve French
parent 8de5571045
commit 6a67fe6212

View File

@ -1325,8 +1325,6 @@ static int smbd_post_recv(
response->sge.length = sp->max_recv_size;
response->sge.lkey = sc->ib.pd->local_dma_lkey;
response->cqe.done = recv_done;
recv_wr.wr_cqe = &response->cqe;
recv_wr.next = NULL;
recv_wr.sg_list = &response->sge;
@ -1534,6 +1532,7 @@ static struct smbd_connection *_smbd_get_connection(
__be32 ird_ord_hdr[2];
char wq_name[80];
struct workqueue_struct *workqueue;
struct smbdirect_recv_io *recv_io;
/*
* Create the initial parameters
@ -1638,6 +1637,9 @@ static struct smbd_connection *_smbd_get_connection(
goto allocate_cache_failed;
}
list_for_each_entry(recv_io, &sc->recv_io.free.list, list)
recv_io->cqe.done = recv_done;
INIT_WORK(&sc->idle.immediate_work, send_immediate_empty_message);
/*
* start with the negotiate timeout and SMBDIRECT_KEEPALIVE_PENDING