]> granicus.if.org Git - spl/commitdiff
Linux 2.6.31 Compatibility Updates
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 10 Nov 2009 22:06:57 +0000 (14:06 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 10 Nov 2009 22:06:57 +0000 (14:06 -0800)
SPL_AC_2ARGS_SET_FS_PWD macro updated to explicitly include
linux/fs_struct.h which was dropped from linux/sched.h.

min_wmark_pages, low_wmark_pages, high_wmark_pages macros
introduced in newer kernels.  For older kernels mm_compat.h
was introduced to define them as needed as direct mappings
to per zone min_pages, low_pages, max_pages.

config/spl-build.m4
configure
include/linux/mm_compat.h [new file with mode: 0644]
include/sys/kmem.h
include/sys/vnode.h
module/spl/spl-kmem.c

index ae45e29da4ae53804d67b34b2b9e17f97a10abb7..f50e1757fb63e5b8c73f1331be3b7adece2ae8d9 100644 (file)
@@ -1266,6 +1266,7 @@ AC_DEFUN([SPL_AC_2ARGS_SET_FS_PWD],
        [AC_MSG_CHECKING([whether set_fs_pwd() wants 2 args])
        SPL_LINUX_TRY_COMPILE([
                #include <linux/sched.h>
+               #include <linux/fs_struct.h>
        ],[
                set_fs_pwd(NULL, NULL);
        ],[
index 15fea65f9890022e1dcaf9698ce84b321ff89099..3beeb5df064a06bd0a6e3c4205f33b14804094f6 100755 (executable)
--- a/configure
+++ b/configure
@@ -21871,6 +21871,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 
                #include <linux/sched.h>
+               #include <linux/fs_struct.h>
 
 int
 main (void)
@@ -25119,6 +25120,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 
                #include <linux/sched.h>
+               #include <linux/fs_struct.h>
 
 int
 main (void)
diff --git a/include/linux/mm_compat.h b/include/linux/mm_compat.h
new file mode 100644 (file)
index 0000000..c99027b
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef _SPL_MM_COMPAT_H
+#define _SPL_MM_COMPAT_H
+
+#include <linux/mm.h>
+
+/*
+ * Linux 2.6.31 API Change.
+ * Individual pages_{min,low,high} moved in to watermark array.
+ */
+#ifndef min_wmark_pages
+#define min_wmark_pages(z)     (z->pages_min)
+#endif
+
+#ifndef low_wmark_pages
+#define low_wmark_pages(z)     (z->pages_low)
+#endif
+
+#ifndef high_wmark_pages
+#define high_wmark_pages(z)    (z->pages_high)
+#endif
+
+#endif /* SPL_MM_COMPAT_H */
index 7cfbc49e55766ac0d5291cfe73152d18d5757ec1..3e5eb204f97d2aacfde24ee9ba120a5fee20cd26 100644 (file)
@@ -36,7 +36,7 @@ extern "C" {
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
-#include <linux/mm.h>
+#include <linux/mm_compat.h>
 #include <linux/spinlock.h>
 #include <linux/rwsem.h>
 #include <linux/hash.h>
index d8a8df2722bc91bac80d245b4d9f4a1eae135713..9568a1392632819d4268f59d625e9b300124e95a 100644 (file)
@@ -39,6 +39,7 @@ extern "C" {
 #include <linux/namei.h>
 #include <linux/file.h>
 #include <linux/fs.h>
+#include <linux/fs_struct.h>
 #include <linux/mount.h>
 #include <sys/kmem.h>
 #include <sys/mutex.h>
index 00d37c798fad7e7a2f3070a5e5b31278ebdbf182..79a7028c2f831a98407132b8ed59a006acaa3a73 100644 (file)
@@ -1826,9 +1826,9 @@ spl_kmem_init_globals(void)
                 if (!populated_zone(zone))
                         continue;
 
-               minfree += zone->pages_min;
-               desfree += zone->pages_low;
-               lotsfree += zone->pages_high;
+               minfree += min_wmark_pages(zone);
+               desfree += low_wmark_pages(zone);
+               lotsfree += high_wmark_pages(zone);
        }
 
        /* Solaris default values */