linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ipvs: Simplify the allocation of ip_vs_conn slab caches
@ 2024-01-17  7:20 Kunwu Chan
  2024-01-17  9:16 ` Denis Kirjanov
  2024-01-17  9:29 ` Simon Horman
  0 siblings, 2 replies; 6+ messages in thread
From: Kunwu Chan @ 2024-01-17  7:20 UTC (permalink / raw)
  To: horms, ja, pablo, kadlec, fw, davem, edumazet, kuba, pabeni
  Cc: netdev, lvs-devel, netfilter-devel, coreteam, linux-kernel,
	Kunwu Chan

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>
---
 net/netfilter/ipvs/ip_vs_conn.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index a743db073887..98d7dbe3d787 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -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;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-01-22  7:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-17  7:20 [PATCH net] ipvs: Simplify the allocation of ip_vs_conn slab caches Kunwu Chan
2024-01-17  9:16 ` Denis Kirjanov
2024-01-17  9:29 ` Simon Horman
2024-01-18  2:22   ` Kunwu Chan
2024-01-19 15:20     ` Simon Horman
2024-01-22  7:35       ` Kunwu Chan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).