Commit d5f9142f authored by Kunwu Chan's avatar Kunwu Chan Committed by Florian Westphal

ipvs: Simplify the allocation of ip_vs_conn slab caches

Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.
Signed-off-by: default avatarKunwu Chan <chentao@kylinos.cn>
Acked-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
parent 2ae6e9a0
...@@ -1511,9 +1511,7 @@ int __init ip_vs_conn_init(void) ...@@ -1511,9 +1511,7 @@ int __init ip_vs_conn_init(void)
return -ENOMEM; return -ENOMEM;
/* Allocate ip_vs_conn slab cache */ /* Allocate ip_vs_conn slab cache */
ip_vs_conn_cachep = kmem_cache_create("ip_vs_conn", ip_vs_conn_cachep = KMEM_CACHE(ip_vs_conn, SLAB_HWCACHE_ALIGN);
sizeof(struct ip_vs_conn), 0,
SLAB_HWCACHE_ALIGN, NULL);
if (!ip_vs_conn_cachep) { if (!ip_vs_conn_cachep) {
kvfree(ip_vs_conn_tab); kvfree(ip_vs_conn_tab);
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment