Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Feb 2018 10:35:29 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r329972 - stable/11/sys/compat/linuxkpi/common/include/linux
Message-ID:  <201802251035.w1PAZTxv018392@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Sun Feb 25 10:35:28 2018
New Revision: 329972
URL: https://svnweb.freebsd.org/changeset/base/329972

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

Modified:
  stable/11/sys/compat/linuxkpi/common/include/linux/slab.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linuxkpi/common/include/linux/slab.h
==============================================================================
--- stable/11/sys/compat/linuxkpi/common/include/linux/slab.h	Sun Feb 25 10:34:47 2018	(r329971)
+++ stable/11/sys/compat/linuxkpi/common/include/linux/slab.h	Sun Feb 25 10:35:28 2018	(r329972)
@@ -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 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802251035.w1PAZTxv018392>