smb: client: count the number of posted recv_io messages in order to calculated credits
authorStefan Metzmacher <metze@samba.org>
Thu, 14 Aug 2025 11:57:37 +0000 (13:57 +0200)
committerSteve French <stfrench@microsoft.com>
Sun, 28 Sep 2025 23:29:49 +0000 (18:29 -0500)
commit5fb9b459b3686e366640edd4e62805ef7b4de927
tree5980a7658be36ccd3c355f0a82c7afeec42729da
parent9219f8cac296769324bbe8a28c289586114244c4
smb: client: count the number of posted recv_io messages in order to calculated credits

(At least for me) the logic maintaining the count of posted
recv_io messages and the count of granted credits is much easier
to understand.

From there we can easily calculate the number of new_credits we'll
grant to the peer in outgoing send_io messages.

This will simplify the move to common logic that can be
shared between client and server in the following patches.

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
fs/smb/client/smbdirect.h