smb: client: pass struct smbdirect_socket to manage_credits_prior_sending()

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>
This commit is contained in:
Stefan Metzmacher
2025-08-22 10:18:12 +02:00
committed by Steve French
parent be8602d47d
commit 869bb7284f

View File

@@ -957,9 +957,8 @@ static int smbd_post_send_negotiate_req(struct smbd_connection *info)
* buffer as possible, and extend the receive credits to remote peer
* return value: the new credtis being granted.
*/
static int manage_credits_prior_sending(struct smbd_connection *info)
static int manage_credits_prior_sending(struct smbdirect_socket *sc)
{
struct smbdirect_socket *sc = &info->socket;
int new_credits;
if (atomic_read(&sc->recv_io.credits.count) >= sc->recv_io.credits.target)
@@ -1127,7 +1126,7 @@ static int smbd_post_send_iter(struct smbd_connection *info,
packet = smbdirect_send_io_payload(request);
packet->credits_requested = cpu_to_le16(sp->send_credit_target);
new_credits = manage_credits_prior_sending(info);
new_credits = manage_credits_prior_sending(sc);
atomic_add(new_credits, &sc->recv_io.credits.count);
packet->credits_granted = cpu_to_le16(new_credits);