From: Christian Brauner Date: Thu, 5 Sep 2024 07:56:53 +0000 (+0200) Subject: slab: port KMEM_CACHE() to struct kmem_cache_args X-Git-Tag: v6.12-rc1~162^2^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=052d67b46bcd91b6785e8e6e047241814f6142a3;p=thirdparty%2Fkernel%2Flinux.git slab: port KMEM_CACHE() to struct kmem_cache_args Make KMEM_CACHE() use struct kmem_cache_args. Reviewed-by: Kees Cook Reviewed-by: Jens Axboe Reviewed-by: Mike Rapoport (Microsoft) Reviewed-by: Vlastimil Babka Signed-off-by: Christian Brauner Reviewed-by: Roman Gushchin Signed-off-by: Vlastimil Babka --- diff --git a/include/linux/slab.h b/include/linux/slab.h index 2b8eeca7fd2cb..1f38d94387cc0 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -284,9 +284,11 @@ int kmem_cache_shrink(struct kmem_cache *s); * f.e. add ____cacheline_aligned_in_smp to the struct declaration * then the objects will be properly aligned in SMP configurations. */ -#define KMEM_CACHE(__struct, __flags) \ - kmem_cache_create(#__struct, sizeof(struct __struct), \ - __alignof__(struct __struct), (__flags), NULL) +#define KMEM_CACHE(__struct, __flags) \ + __kmem_cache_create_args(#__struct, sizeof(struct __struct), \ + &(struct kmem_cache_args) { \ + .align = __alignof__(struct __struct), \ + }, (__flags)) /* * To whitelist a single field for copying to/from usercopy, use this