On Thu, Sep 05, 2024 at 09:56:45AM +0200, Christian Brauner wrote: > 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@xxxxxxxxxx> > Reviewed-by: Jens Axboe <axboe@xxxxxxxxx> > Reviewed-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx> > Reviewed-by: Vlastimil Babka <vbabka@xxxxxxx> > Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx> Reviewed-by: Roman Gushchin <roman.gushchin@xxxxxxxxx>