]> www.infradead.org Git - users/willy/xarray.git/commit
slab: create kmem_cache_create() compatibility layer
authorChristian Brauner <brauner@kernel.org>
Thu, 5 Sep 2024 07:56:55 +0000 (09:56 +0200)
committerVlastimil Babka <vbabka@suse.cz>
Tue, 10 Sep 2024 09:42:58 +0000 (11:42 +0200)
commitb2e7456b5c25c41eda7a8a15f7ccaa4e7579949f
treebc15f0c9a565c7a9f786c6d0be5a168d98927e5f
parent199cd13a745eb44fb4828bca373155293cdcfa5c
slab: create kmem_cache_create() compatibility layer

Use _Generic() to create a compatibility layer that type switches on the
third argument to either call __kmem_cache_create() or
__kmem_cache_create_args(). If NULL is passed for the struct
kmem_cache_args argument use default args making porting for callers
that don't care about additional arguments easy.

Reviewed-by: Kees Cook <kees@kernel.org>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Roman Gushchin <roman.gushchin@linux.dev>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
include/linux/slab.h
mm/slab_common.c