]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ipvs: Simplify the allocation of ip_vs_conn slab caches
authorKunwu Chan <chentao@kylinos.cn>
Wed, 17 Jan 2024 07:20:45 +0000 (15:20 +0800)
committerFlorian Westphal <fw@strlen.de>
Mon, 29 Jan 2024 14:43:20 +0000 (15:43 +0100)
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Acked-by: Simon Horman <horms@kernel.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
net/netfilter/ipvs/ip_vs_conn.c

index a743db07388723b52531372d85dfa32a4ae69599..98d7dbe3d78760d6bdeb2e5147cda2f909ff9828 100644 (file)
@@ -1511,9 +1511,7 @@ int __init ip_vs_conn_init(void)
                return -ENOMEM;
 
        /* Allocate ip_vs_conn slab cache */
-       ip_vs_conn_cachep = kmem_cache_create("ip_vs_conn",
-                                             sizeof(struct ip_vs_conn), 0,
-                                             SLAB_HWCACHE_ALIGN, NULL);
+       ip_vs_conn_cachep = KMEM_CACHE(ip_vs_conn, SLAB_HWCACHE_ALIGN);
        if (!ip_vs_conn_cachep) {
                kvfree(ip_vs_conn_tab);
                return -ENOMEM;