]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
smb: smbdirect: introduce smbdirect_socket.{send,recv}_io.mem.gfp_mask
authorStefan Metzmacher <metze@samba.org>
Thu, 11 Sep 2025 17:41:53 +0000 (19:41 +0200)
committerSteve French <stfrench@microsoft.com>
Thu, 16 Apr 2026 02:58:18 +0000 (21:58 -0500)
This will allow common code to be split out while still using the
gfp_mask currently used.

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

index 44506fc5cb92fe6cc158b3c407ad10ced0d5009d..ef0c488143116d3a60bd3f8047e3eb25b8f365f8 100644 (file)
@@ -158,8 +158,9 @@ struct smbdirect_socket {
                 * smbdirect_send_io buffers
                 */
                struct {
-                       struct kmem_cache       *cache;
-                       mempool_t               *pool;
+                       struct kmem_cache *cache;
+                       mempool_t *pool;
+                       gfp_t gfp_mask;
                } mem;
 
                /*
@@ -223,8 +224,9 @@ struct smbdirect_socket {
                 * smbdirect_recv_io buffers
                 */
                struct {
-                       struct kmem_cache       *cache;
-                       mempool_t               *pool;
+                       struct kmem_cache *cache;
+                       mempool_t *pool;
+                       gfp_t gfp_mask;
                } mem;
 
                /*
@@ -505,6 +507,8 @@ static __always_inline void smbdirect_socket_init(struct smbdirect_socket *sc)
        INIT_DELAYED_WORK(&sc->idle.timer_work, __smbdirect_socket_disabled_work);
        disable_delayed_work_sync(&sc->idle.timer_work);
 
+       sc->send_io.mem.gfp_mask = GFP_KERNEL;
+
        atomic_set(&sc->send_io.bcredits.count, 0);
        init_waitqueue_head(&sc->send_io.bcredits.wait_queue);
 
@@ -518,6 +522,8 @@ static __always_inline void smbdirect_socket_init(struct smbdirect_socket *sc)
        init_waitqueue_head(&sc->send_io.pending.dec_wait_queue);
        init_waitqueue_head(&sc->send_io.pending.zero_wait_queue);
 
+       sc->recv_io.mem.gfp_mask = GFP_KERNEL;
+
        INIT_LIST_HEAD(&sc->recv_io.free.list);
        spin_lock_init(&sc->recv_io.free.lock);