Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Kunwu Chan <chentao@kylinos.cn>
Acked-by: Simon Horman <horms@kernel.org>
Signed-off-by: Florian Westphal <fw@strlen.de>

authored by

Kunwu Chan and committed by
Florian Westphal
d5f9142f 2ae6e9a0

+1 -3
+1 -3
net/netfilter/ipvs/ip_vs_conn.c
··· 1511 1511 return -ENOMEM; 1512 1512 1513 1513 /* Allocate ip_vs_conn slab cache */ 1514 - ip_vs_conn_cachep = kmem_cache_create("ip_vs_conn", 1515 - sizeof(struct ip_vs_conn), 0, 1516 - SLAB_HWCACHE_ALIGN, NULL); 1514 + ip_vs_conn_cachep = KMEM_CACHE(ip_vs_conn, SLAB_HWCACHE_ALIGN); 1517 1515 if (!ip_vs_conn_cachep) { 1518 1516 kvfree(ip_vs_conn_tab); 1519 1517 return -ENOMEM;