]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Move GFP flags kernel compatibility code
authorMichael Niewöhner <c0d3z3r0@users.noreply.github.com>
Mon, 8 Jun 2020 23:33:46 +0000 (01:33 +0200)
committerGitHub <noreply@github.com>
Mon, 8 Jun 2020 23:33:46 +0000 (16:33 -0700)
Move the GFP flags kernel compat code from c file to kmem header.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
Closes #10424

include/os/linux/spl/sys/kmem.h
module/os/linux/spl/spl-kmem.c

index 176858dc22be555f1ada7c54fbab86a24ff53fa5..c09c40fa34b9f564ab8c3cce085753448d5b8b7e 100644 (file)
@@ -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)
index 0bb82ac7af0a3b9e9a80bd3dd108df9306ffffeb..f19421cfcc03a2041199bfa29db6415890daa8db 100644 (file)
@@ -132,15 +132,6 @@ kmem_strfree(char *str)
 }
 EXPORT_SYMBOL(kmem_strfree);
 
-/* Kernel compatibility for <4.13 */
-#ifndef __GFP_RETRY_MAYFAIL
-#define        __GFP_RETRY_MAYFAIL     __GFP_REPEAT
-#endif
-/* Kernel compatibility for <4.4 */
-#ifndef __GFP_RECLAIM
-#define        __GFP_RECLAIM           __GFP_WAIT
-#endif
-
 void *
 spl_kvmalloc(size_t size, gfp_t lflags)
 {