]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
smb: smbdirect: introduce smbdirect_socket.send_io.pending.{count,{dec,zero}_wait_queue}
authorStefan Metzmacher <metze@samba.org>
Mon, 11 Aug 2025 13:19:51 +0000 (15:19 +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 ab36c2271e3ecac2e4046cf4ce937340bb02b09d..1df43b7a87f46d7fb87136d96b0f225112e1c9d7 100644 (file)
@@ -77,6 +77,21 @@ struct smbdirect_socket {
                        struct kmem_cache       *cache;
                        mempool_t               *pool;
                } mem;
+
+               /*
+                * The state about posted/pending sends
+                */
+               struct {
+                       atomic_t count;
+                       /*
+                        * woken when count is decremented
+                        */
+                       wait_queue_head_t dec_wait_queue;
+                       /*
+                        * woken when count reached zero
+                        */
+                       wait_queue_head_t zero_wait_queue;
+               } pending;
        } send_io;
 
        /*
@@ -148,6 +163,10 @@ static __always_inline void smbdirect_socket_init(struct smbdirect_socket *sc)
 
        init_waitqueue_head(&sc->status_wait);
 
+       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);
+
        INIT_LIST_HEAD(&sc->recv_io.free.list);
        spin_lock_init(&sc->recv_io.free.lock);