]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - spl/include/sys/vmsystm.h
UBUNTU: SAUCE: add workarounds to enable ZFS for 4.14
[mirror_ubuntu-bionic-kernel.git] / spl / include / sys / vmsystm.h
index 9d334fe0a16e7bcf04bbdb61be80eaedf596f651..edc0b38249b24e6eb7d6e9b0c14fa959000664d7 100644 (file)
 #include <linux/swap.h>
 #include <linux/highmem.h>
 #include <linux/vmalloc.h>
+#include <linux/version.h>
 #include <sys/types.h>
 #include <asm/uaccess.h>
 
 #define        membar_producer()               smp_wmb()
 #define        physmem                         totalram_pages
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0)
 #define        freemem                 (nr_free_pages() + \
                                global_page_state(NR_INACTIVE_FILE) + \
                                global_page_state(NR_INACTIVE_ANON) + \
                                global_page_state(NR_SLAB_RECLAIMABLE))
+#else
+#define        freemem                 (nr_free_pages() + \
+                               global_zone_page_state(NR_INACTIVE_FILE) + \
+                               global_zone_page_state(NR_INACTIVE_ANON) + \
+                               global_zone_page_state(NR_SLAB_RECLAIMABLE))
+#endif
 
 #define        xcopyin(from, to, size)         copy_from_user(to, from, size)
 #define        xcopyout(from, to, size)        copy_to_user(to, from, size)