Author: hselasky
Date: Sun Feb 18 09:52:30 2018
New Revision: 329516
URL: https://svnweb.freebsd.org/changeset/base/329516

Log:
  Implement the KMEM_CACHE() function macro in the LinuxKPI.
  
  MFC after:    1 week
  Submitted by: Johannes Lundberg <johal...@gmail.com>
  Sponsored by: Mellanox Technologies
  Sponsored by: Limelight Networks

Modified:
  head/sys/compat/linuxkpi/common/include/linux/slab.h

Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/slab.h        Sun Feb 18 
09:31:01 2018        (r329515)
+++ head/sys/compat/linuxkpi/common/include/linux/slab.h        Sun Feb 18 
09:52:30 2018        (r329516)
@@ -65,6 +65,10 @@ MALLOC_DECLARE(M_KMALLOC);
 #define        kmem_cache_free(...)    linux_kmem_cache_free(__VA_ARGS__)
 #define        kmem_cache_destroy(...) linux_kmem_cache_destroy(__VA_ARGS__)
 
+#define        KMEM_CACHE(__struct, flags)                                     
\
+       linux_kmem_cache_create(#__struct, sizeof(struct __struct),     \
+       __alignof(struct __struct), (flags), NULL)
+
 typedef void linux_kmem_ctor_t (void *);
 
 struct linux_kmem_cache {
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to