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

net: rds: Simplify the allocation of slab caches in rds_conn_init

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>
Link: https://lore.kernel.org/r/20240124075801.471330-1-chentao@kylinos.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Kunwu Chan and committed by
Jakub Kicinski
047a7d26 d0005e76

+1 -3
+1 -3
net/rds/connection.c
··· 829 829 if (ret) 830 830 return ret; 831 831 832 - rds_conn_slab = kmem_cache_create("rds_connection", 833 - sizeof(struct rds_connection), 834 - 0, 0, NULL); 832 + rds_conn_slab = KMEM_CACHE(rds_connection, 0); 835 833 if (!rds_conn_slab) { 836 834 rds_loop_net_exit(); 837 835 return -ENOMEM;