DORMANTno replies

[PATCH] net: rds: Simplify the allocation of slab caches in rds_tcp_init

From: Kunwu Chan <hidden>
Date: 2024-01-24 06:52:13
Also in: linux-rdma, lkml
Subsystem: networking [general], rds - reliable datagram sockets, the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Allison Henderson, Linus Torvalds

Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.

Signed-off-by: Kunwu Chan <redacted>
---
 net/rds/tcp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/rds/tcp.c b/net/rds/tcp.c
index 2dba7505b414..73317c86e995 100644
--- a/net/rds/tcp.c
+++ b/net/rds/tcp.c
@@ -720,9 +720,7 @@ static int __init rds_tcp_init(void)
 {
 	int ret;
 
-	rds_tcp_conn_slab = kmem_cache_create("rds_tcp_connection",
-					      sizeof(struct rds_tcp_connection),
-					      0, 0, NULL);
+	rds_tcp_conn_slab = KMEM_CACHE(rds_tcp_connection, 0);
 	if (!rds_tcp_conn_slab) {
 		ret = -ENOMEM;
 		goto out;
-- 
2.39.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help