mirror of
https://github.com/torvalds/linux.git
synced 2026-03-14 02:06:15 +01:00
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:
parent
dacf472bcd
commit
052d67b46b
1 changed files with 5 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue