slab: port kmem_cache_create_rcu() to struct kmem_cache_args

Port kmem_cache_create_rcu() to 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:
Christian Brauner 2024-09-05 09:56:47 +02:00 committed by Vlastimil Babka
parent f6cd98c940
commit 9816c3c4e7

View File

@ -481,9 +481,13 @@ struct kmem_cache *kmem_cache_create_rcu(const char *name, unsigned int size,
unsigned int freeptr_offset,
slab_flags_t flags)
{
return do_kmem_cache_create_usercopy(name, size, freeptr_offset, 0,
flags | SLAB_TYPESAFE_BY_RCU, 0, 0,
NULL);
struct kmem_cache_args kmem_args = {
.freeptr_offset = freeptr_offset,
.use_freeptr_offset = true,
};
return __kmem_cache_create_args(name, size, &kmem_args,
flags | SLAB_TYPESAFE_BY_RCU);
}
EXPORT_SYMBOL(kmem_cache_create_rcu);