mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
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.
This commit is contained in:
@@ -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)
|
||||
])
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user