[PATCH RFC 2/6] slab: port KMEM_CACHE() to kmem_cache_setup()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make KMEM_CACHE() use the new kmem_cache_setup() helper.

Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx>
---
 include/linux/slab.h | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/include/linux/slab.h b/include/linux/slab.h
index 41135ea03299..79f4799b7083 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -283,9 +283,13 @@ int kmem_cache_shrink(struct kmem_cache *s);
  * f.e. add ____cacheline_aligned_in_smp to the struct declaration
  * then the objects will be properly aligned in SMP configurations.
  */
-#define KMEM_CACHE(__struct, __flags)					\
-		kmem_cache_create(#__struct, sizeof(struct __struct),	\
-			__alignof__(struct __struct), (__flags), NULL)
+#define KMEM_CACHE(__struct, __flags)                                   \
+	kmem_cache_setup(#__struct, sizeof(struct __struct),            \
+			 &(struct kmem_cache_args){                     \
+				 .align = __alignof__(struct __struct), \
+				 .ctor = NULL,                          \
+			 },                                             \
+			 (__flags))
 
 /*
  * To whitelist a single field for copying to/from usercopy, use this

-- 
2.45.2





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux