diff mbox series

[v2,03/15] slab: port kmem_cache_create() to struct kmem_cache_args

Message ID 20240903-work-kmem_cache_args-v2-3-76f97e9a4560@kernel.org (mailing list archive)
State New
Headers show
Series slab: add struct kmem_cache_args | expand

Commit Message

Christian Brauner Sept. 3, 2024, 2:20 p.m. UTC
Port kmem_cache_create() to struct kmem_cache_args.

Signed-off-by: Christian Brauner <brauner@kernel.org>
---
 mm/slab_common.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Mike Rapoport Sept. 4, 2024, 4:55 a.m. UTC | #1
On Tue, Sep 03, 2024 at 04:20:44PM +0200, Christian Brauner wrote:
> Port kmem_cache_create() to struct kmem_cache_args.
> 
> Signed-off-by: Christian Brauner <brauner@kernel.org>

Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>

> ---
>  mm/slab_common.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/slab_common.c b/mm/slab_common.c
> index 0f13c045b8d1..ac0832dac01e 100644
> --- a/mm/slab_common.c
> +++ b/mm/slab_common.c
> @@ -439,8 +439,12 @@ struct kmem_cache *
>  kmem_cache_create(const char *name, unsigned int size, unsigned int align,
>  		slab_flags_t flags, void (*ctor)(void *))
>  {
> -	return do_kmem_cache_create_usercopy(name, size, UINT_MAX, align, flags,
> -					     0, 0, ctor);
> +	struct kmem_cache_args kmem_args = {
> +		.align	= align,
> +		.ctor	= ctor,
> +	};
> +
> +	return __kmem_cache_create_args(name, size, &kmem_args, flags);
>  }
>  EXPORT_SYMBOL(kmem_cache_create);
>  
> 
> -- 
> 2.45.2
>
diff mbox series

Patch

diff --git a/mm/slab_common.c b/mm/slab_common.c
index 0f13c045b8d1..ac0832dac01e 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -439,8 +439,12 @@  struct kmem_cache *
 kmem_cache_create(const char *name, unsigned int size, unsigned int align,
 		slab_flags_t flags, void (*ctor)(void *))
 {
-	return do_kmem_cache_create_usercopy(name, size, UINT_MAX, align, flags,
-					     0, 0, ctor);
+	struct kmem_cache_args kmem_args = {
+		.align	= align,
+		.ctor	= ctor,
+	};
+
+	return __kmem_cache_create_args(name, size, &kmem_args, flags);
 }
 EXPORT_SYMBOL(kmem_cache_create);