slab: port KMEM_CACHE() to struct kmem_cache_args
Make KMEM_CACHE() use struct kmem_cache_args. Reviewed-by: Kees Cook <kees@kernel.org> Reviewed-by: Jens Axboe <axboe@kernel.dk> Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Reviewed-by: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org> Reviewed-by: Roman Gushchin <roman.gushchin@linux.dev> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
This commit is contained in:
committed by
Vlastimil Babka
parent
dacf472bcd
commit
052d67b46b
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user