Skip to content

Commit

Permalink
ipvs: Simplify the allocation of ip_vs_conn slab caches
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kunwu Chan authored and Florian Westphal committed Jan 29, 2024
1 parent 2ae6e9a commit d5f9142
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/netfilter/ipvs/ip_vs_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d5f9142

Please sign in to comment.