]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
smb: smbdirect: introduce smbdirect_socket.send_io.credits.{count,wait_queue}
authorStefan Metzmacher <metze@samba.org>
Mon, 11 Aug 2025 14:03:00 +0000 (16:03 +0200)
committerSteve French <stfrench@microsoft.com>
Sun, 28 Sep 2025 23:29:47 +0000 (18:29 -0500)
This will be shared between client and server soon.

Cc: Steve French <smfrench@gmail.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Long Li <longli@microsoft.com>
Acked-by: 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>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/common/smbdirect/smbdirect_socket.h

index 1df43b7a87f46d7fb87136d96b0f225112e1c9d7..7c2147a0244a4f3f7d0abca9e72841c6c0017157 100644 (file)
@@ -78,6 +78,14 @@ struct smbdirect_socket {
                        mempool_t               *pool;
                } mem;
 
+               /*
+                * The credit state for the send side
+                */
+               struct {
+                       atomic_t count;
+                       wait_queue_head_t wait_queue;
+               } credits;
+
                /*
                 * The state about posted/pending sends
                 */
@@ -163,6 +171,9 @@ static __always_inline void smbdirect_socket_init(struct smbdirect_socket *sc)
 
        init_waitqueue_head(&sc->status_wait);
 
+       atomic_set(&sc->send_io.credits.count, 0);
+       init_waitqueue_head(&sc->send_io.credits.wait_queue);
+
        atomic_set(&sc->send_io.pending.count, 0);
        init_waitqueue_head(&sc->send_io.pending.dec_wait_queue);
        init_waitqueue_head(&sc->send_io.pending.zero_wait_queue);