Skip to content

Commit 052d67b

Browse files
braunertehcaster
authored andcommitted
slab: port KMEM_CACHE() to struct kmem_cache_args
Make KMEM_CACHE() use struct kmem_cache_args. Reviewed-by: Kees Cook <[email protected]> Reviewed-by: Jens Axboe <[email protected]> Reviewed-by: Mike Rapoport (Microsoft) <[email protected]> Reviewed-by: Vlastimil Babka <[email protected]> Signed-off-by: Christian Brauner <[email protected]> Reviewed-by: Roman Gushchin <[email protected]> Signed-off-by: Vlastimil Babka <[email protected]>
1 parent dacf472 commit 052d67b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

include/linux/slab.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,11 @@ int kmem_cache_shrink(struct kmem_cache *s);
284284
* f.e. add ____cacheline_aligned_in_smp to the struct declaration
285285
* then the objects will be properly aligned in SMP configurations.
286286
*/
287-
#define KMEM_CACHE(__struct, __flags) \
288-
kmem_cache_create(#__struct, sizeof(struct __struct), \
289-
__alignof__(struct __struct), (__flags), NULL)
287+
#define KMEM_CACHE(__struct, __flags) \
288+
__kmem_cache_create_args(#__struct, sizeof(struct __struct), \
289+
&(struct kmem_cache_args) { \
290+
.align = __alignof__(struct __struct), \
291+
}, (__flags))
290292

291293
/*
292294
* To whitelist a single field for copying to/from usercopy, use this

0 commit comments

Comments
 (0)