diff options
author | Brian Behlendorf <[email protected]> | 2011-06-16 15:39:08 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-06-21 14:02:39 -0700 |
commit | a55bcaad181096d764e12d847e3091cd7b15509a (patch) | |
tree | dc3b2a033d186854c8d92cf70bc2b4545847e415 /config | |
parent | a32661a6c976c1d8100ddd8e60c958ae8db98747 (diff) |
Linux 3.0: Shrinker compatibility
Update the the wrapper macros for the memory shrinker to handle
this 4th API change. The callback function now takes a
shrink_control structure. This is certainly a step in the
right direction but it's annoying to have to accomidate yet
another version of the API.
Diffstat (limited to 'config')
-rw-r--r-- | config/spl-build.m4 | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/config/spl-build.m4 b/config/spl-build.m4 index b25db38f3..75267bb83 100644 --- a/config/spl-build.m4 +++ b/config/spl-build.m4 @@ -81,6 +81,7 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [ SPL_AC_SHRINK_ICACHE_MEMORY SPL_AC_KERN_PATH_PARENT SPL_AC_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE + SPL_AC_SHRINK_CONTROL_STRUCT ]) AC_DEFUN([SPL_AC_MODULE_SYMVERS], [ @@ -1810,3 +1811,25 @@ AC_DEFUN([SPL_AC_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE], AC_MSG_RESULT(no) ]) ]) + +dnl # +dnl # 2.6.39 API change, +dnl # Shrinker adjust to use common shrink_control structure. +dnl # +AC_DEFUN([SPL_AC_SHRINK_CONTROL_STRUCT], [ + AC_MSG_CHECKING([whether struct shrink_control exists]) + SPL_LINUX_TRY_COMPILE([ + #include <linux/mm.h> + ],[ + struct shrink_control sc __attribute__ ((unused)); + + sc.nr_to_scan = 0; + sc.gfp_mask = GFP_KERNEL; + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_SHRINK_CONTROL_STRUCT, 1, + [struct shrink_control exists]) + ],[ + AC_MSG_RESULT(no) + ]) +]) |