[PATCH v4 021/145] smb: smbdirect: introduce smbdirect_socket.{send, recv}_io.mem.gfp_mask
Stefan Metzmacher
metze at samba.org
Tue Nov 25 17:54:27 UTC 2025
This will allow common code to be split out while still using the
gfp_mask currently used.
Cc: Steve French <smfrench at gmail.com>
Cc: Tom Talpey <tom at talpey.com>
Cc: Long Li <longli at microsoft.com>
Cc: Namjae Jeon <linkinjeon at kernel.org>
Cc: linux-cifs at vger.kernel.org
Cc: samba-technical at lists.samba.org
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Signed-off-by: Steve French <stfrench at microsoft.com>
---
fs/smb/common/smbdirect/smbdirect_socket.h | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/fs/smb/common/smbdirect/smbdirect_socket.h b/fs/smb/common/smbdirect/smbdirect_socket.h
index f56f2b037a69..5564cf9d999f 100644
--- a/fs/smb/common/smbdirect/smbdirect_socket.h
+++ b/fs/smb/common/smbdirect/smbdirect_socket.h
@@ -150,8 +150,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;
/*
@@ -204,8 +205,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;
/*
@@ -481,6 +483,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.lcredits.count, 0);
init_waitqueue_head(&sc->send_io.lcredits.wait_queue);
@@ -491,6 +495,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);
--
2.43.0
More information about the samba-technical
mailing list