Page MenuHomeFreeBSD

D45815.diff
No OneTemporary

D45815.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
@@ -92,6 +92,8 @@
#define ZERO_OR_NULL_PTR(x) ((x) == NULL || (x) == ZERO_SIZE_PTR)
extern void *lkpi_kmalloc(size_t size, gfp_t flags);
+void *lkpi___kmalloc(size_t size, gfp_t flags);
+#define __kmalloc(_s, _f) lkpi___kmalloc(_s, _f)
static inline gfp_t
linux_check_m_flags(gfp_t flags)
@@ -108,13 +110,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,17 @@
free(c, M_KMALLOC);
}
+void *
+lkpi___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
Thu, Oct 3, 2:29 AM (22 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
13416015
Default Alt Text
D45815.diff (1 KB)

Event Timeline