diff options
author | Brian Behlendorf <[email protected]> | 2009-11-10 14:06:57 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2009-11-10 14:06:57 -0800 |
commit | baf2979ed35c1a9c2e90e84416e220ab3d25140a (patch) | |
tree | 9040926a680c1a31ae6734cd5f014cbfc1d7e1d3 | |
parent | f97cd5fd875e8c28c6411ef86845ad0ec283f115 (diff) |
Linux 2.6.31 Compatibility Updates
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.
-rw-r--r-- | config/spl-build.m4 | 1 | ||||
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | include/linux/mm_compat.h | 22 | ||||
-rw-r--r-- | include/sys/kmem.h | 2 | ||||
-rw-r--r-- | include/sys/vnode.h | 1 | ||||
-rw-r--r-- | module/spl/spl-kmem.c | 6 |
6 files changed, 30 insertions, 4 deletions
diff --git a/config/spl-build.m4 b/config/spl-build.m4 index ae45e29da..f50e1757f 100644 --- a/config/spl-build.m4 +++ b/config/spl-build.m4 @@ -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); ],[ @@ -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 index 000000000..c99027b44 --- /dev/null +++ b/include/linux/mm_compat.h @@ -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 */ diff --git a/include/sys/kmem.h b/include/sys/kmem.h index 7cfbc49e5..3e5eb204f 100644 --- a/include/sys/kmem.h +++ b/include/sys/kmem.h @@ -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> diff --git a/include/sys/vnode.h b/include/sys/vnode.h index d8a8df272..9568a1392 100644 --- a/include/sys/vnode.h +++ b/include/sys/vnode.h @@ -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> diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c index 00d37c798..79a7028c2 100644 --- a/module/spl/spl-kmem.c +++ b/module/spl/spl-kmem.c @@ -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 */ |