Page MenuHomeFreeBSD

D45815.id140408.diff
No OneTemporary

D45815.id140408.diff

diff --git a/sys/compat/linuxkpi/common/include/linux/slab.h b/sys/compat/linuxkpi/common/include/linux/slab.h
--- a/sys/compat/linuxkpi/common/include/linux/slab.h
+++ b/sys/compat/linuxkpi/common/include/linux/slab.h
@@ -91,6 +91,9 @@
#define ZERO_SIZE_PTR ((void *)16)
#define ZERO_OR_NULL_PTR(x) ((x) == NULL || (x) == ZERO_SIZE_PTR)
+void *linuxkpi___kmalloc(size_t size, gfp_t flags);
+#define __kmalloc(_s, _f) linuxkpi___kmalloc(_s, _f)
+
static inline gfp_t
linux_check_m_flags(gfp_t flags)
{
@@ -106,13 +109,6 @@
return (flags & GFP_NATIVE_MASK);
}
-static inline void *
-__kmalloc(size_t size, gfp_t flags)
-{
- return (malloc(MAX(size, sizeof(struct llist_node)), M_KMALLOC,
- linux_check_m_flags(flags)));
-}
-
static inline void *
kmalloc_node(size_t size, gfp_t flags, int node)
{
diff --git a/sys/compat/linuxkpi/common/src/linux_slab.c b/sys/compat/linuxkpi/common/src/linux_slab.c
--- a/sys/compat/linuxkpi/common/src/linux_slab.c
+++ b/sys/compat/linuxkpi/common/src/linux_slab.c
@@ -207,6 +207,18 @@
free(c, M_KMALLOC);
}
+void *
+linuxkpi___kmalloc(size_t size, gfp_t flags)
+{
+ size_t _s;
+
+ /* sizeof(struct llist_node) is used for kfree_async(). */
+ _s = MAX(size, sizeof(struct llist_node));
+
+ return (malloc(_s, M_KMALLOC, linux_check_m_flags(flags)));
+}
+
+
struct lkpi_kmalloc_ctx {
size_t size;
gfp_t flags;

File Metadata

Mime Type
text/plain
Expires
Mon, May 18, 6:58 AM (13 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33236955
Default Alt Text
D45815.id140408.diff (1 KB)

Event Timeline