Commit 869bb728 authored by Stefan Metzmacher's avatar Stefan Metzmacher Committed by Steve French
Browse files

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: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarStefan Metzmacher <metze@samba.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent be8602d4
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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);