Commit 052d67b4 authored by Christian Brauner's avatar Christian Brauner Committed by Vlastimil Babka

slab: port KMEM_CACHE() to struct kmem_cache_args

Make KMEM_CACHE() use struct kmem_cache_args.
Reviewed-by: default avatarKees Cook <kees@kernel.org>
Reviewed-by: default avatarJens Axboe <axboe@kernel.dk>
Reviewed-by: default avatarMike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: default avatarVlastimil Babka <vbabka@suse.cz>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
Reviewed-by: default avatarRoman Gushchin <roman.gushchin@linux.dev>
Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
parent dacf472b
...@@ -284,9 +284,11 @@ int kmem_cache_shrink(struct kmem_cache *s); ...@@ -284,9 +284,11 @@ int kmem_cache_shrink(struct kmem_cache *s);
* f.e. add ____cacheline_aligned_in_smp to the struct declaration * f.e. add ____cacheline_aligned_in_smp to the struct declaration
* then the objects will be properly aligned in SMP configurations. * then the objects will be properly aligned in SMP configurations.
*/ */
#define KMEM_CACHE(__struct, __flags) \ #define KMEM_CACHE(__struct, __flags) \
kmem_cache_create(#__struct, sizeof(struct __struct), \ __kmem_cache_create_args(#__struct, sizeof(struct __struct), \
__alignof__(struct __struct), (__flags), NULL) &(struct kmem_cache_args) { \
.align = __alignof__(struct __struct), \
}, (__flags))
/* /*
* To whitelist a single field for copying to/from usercopy, use this * To whitelist a single field for copying to/from usercopy, use this
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment