]> www.infradead.org Git - users/willy/xarray.git/commit
slab: add struct kmem_cache_args
authorChristian Brauner <brauner@kernel.org>
Thu, 5 Sep 2024 07:56:45 +0000 (09:56 +0200)
committerVlastimil Babka <vbabka@suse.cz>
Tue, 10 Sep 2024 09:42:57 +0000 (11:42 +0200)
commit879fb3c274c12cb0892718e1e54f85fc406e3c7b
tree5488c5884f54eac47d52266e7f43d96f076cb26e
parent53d3d210864e532ee5d8ae48f66168c12dd8f530
slab: add struct kmem_cache_args

Currently we have multiple kmem_cache_create*() variants that take up to
seven separate parameters with one of the functions having to grow an
eigth parameter in the future to handle both usercopy and a custom
freelist pointer.

Add a struct kmem_cache_args structure and move less common parameters
into it. Core parameters such as name, object size, and flags continue
to be passed separately.

Add a new function __kmem_cache_create_args() that takes a struct
kmem_cache_args pointer and port do_kmem_cache_create_usercopy() over to
it.

In follow-up patches we will port the other kmem_cache_create*()
variants over to it as well.

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>
include/linux/slab.h
mm/slab_common.c