]> www.infradead.org Git - users/hch/configfs.git/commitdiff
rds:Simplify the allocation of slab caches
authorHongfu Li <lihongfu@kylinos.cn>
Mon, 17 Jun 2024 07:54:35 +0000 (15:54 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Jun 2024 09:47:40 +0000 (10:47 +0100)
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.

Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/tcp.c
net/rds/tcp_recv.c

index d8111ac83bb6a510d9986879d890cc7851cb3d96..3dc6956f66f8aafc70234b1772fd73d0a978bd32 100644 (file)
@@ -719,9 +719,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;
index c00f04a1a5347cead4c566fd1e6f02485ceb7a83..7997a19d1da30670625ef483c90b70ec13d5a542 100644 (file)
@@ -337,9 +337,7 @@ out:
 
 int rds_tcp_recv_init(void)
 {
-       rds_tcp_incoming_slab = kmem_cache_create("rds_tcp_incoming",
-                                       sizeof(struct rds_tcp_incoming),
-                                       0, 0, NULL);
+       rds_tcp_incoming_slab = KMEM_CACHE(rds_tcp_incoming, 0);
        if (!rds_tcp_incoming_slab)
                return -ENOMEM;
        return 0;