summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMichael Niewöhner <[email protected]>2020-06-09 01:33:46 +0200
committerGitHub <[email protected]>2020-06-08 16:33:46 -0700
commit32f26eaa70fe9e8aea79311123879f885f674d45 (patch)
treee04373f14fdf6121c428101d6bbc364671a2e1e0 /include
parent080102a1b686a36adaec3a11a9778783462429e8 (diff)
Move GFP flags kernel compatibility code
Move the GFP flags kernel compat code from c file to kmem header. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Michael Niewöhner <[email protected]> Closes #10424
Diffstat (limited to 'include')
-rw-r--r--include/os/linux/spl/sys/kmem.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/os/linux/spl/sys/kmem.h b/include/os/linux/spl/sys/kmem.h
index 176858dc2..c09c40fa3 100644
--- a/include/os/linux/spl/sys/kmem.h
+++ b/include/os/linux/spl/sys/kmem.h
@@ -144,6 +144,18 @@ __spl_pf_fstrans_check(void)
return (current->flags & __SPL_PF_FSTRANS);
}
+/*
+ * Kernel compatibility for GFP flags
+ */
+/* < 4.13 */
+#ifndef __GFP_RETRY_MAYFAIL
+#define __GFP_RETRY_MAYFAIL __GFP_REPEAT
+#endif
+/* < 4.4 */
+#ifndef __GFP_RECLAIM
+#define __GFP_RECLAIM __GFP_WAIT
+#endif
+
#ifdef HAVE_ATOMIC64_T
#define kmem_alloc_used_add(size) atomic64_add(size, &kmem_alloc_used)
#define kmem_alloc_used_sub(size) atomic64_sub(size, &kmem_alloc_used)