diff options
Diffstat (limited to 'config/kernel-shrink.m4')
-rw-r--r-- | config/kernel-shrink.m4 | 110 |
1 files changed, 18 insertions, 92 deletions
diff --git a/config/kernel-shrink.m4 b/config/kernel-shrink.m4 index 4879a129a..30ea1c269 100644 --- a/config/kernel-shrink.m4 +++ b/config/kernel-shrink.m4 @@ -83,6 +83,11 @@ AC_DEFUN([ZFS_AC_KERNEL_SHRINK_CONTROL_HAS_NID], [ ]) ]) +dnl # +dnl # 6.0 API change +dnl # register_shrinker() becomes a var-arg function that takes +dnl # a printf-style format string as args > 0 +dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_REGISTER_SHRINKER_VARARG], [ ZFS_LINUX_TEST_SRC([register_shrinker_vararg], [ #include <linux/mm.h> @@ -98,30 +103,14 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_REGISTER_SHRINKER_VARARG], [ ]) ]) -AC_DEFUN([ZFS_AC_KERNEL_SRC_SHRINKER_CALLBACK], [ - ZFS_LINUX_TEST_SRC([shrinker_cb_shrink_control], [ - #include <linux/mm.h> - static int shrinker_cb(struct shrinker *shrink, - struct shrink_control *sc) { return 0; } - ],[ - struct shrinker cache_shrinker = { - .shrink = shrinker_cb, - .seeks = DEFAULT_SEEKS, - }; - register_shrinker(&cache_shrinker); - ]) - - ZFS_LINUX_TEST_SRC([shrinker_cb_shrink_control_split], [ - #include <linux/mm.h> - static unsigned long shrinker_cb(struct shrinker *shrink, - struct shrink_control *sc) { return 0; } +AC_DEFUN([ZFS_AC_KERNEL_REGISTER_SHRINKER_VARARG],[ + AC_MSG_CHECKING([whether new var-arg register_shrinker() exists]) + ZFS_LINUX_TEST_RESULT([register_shrinker_vararg], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_REGISTER_SHRINKER_VARARG, 1, + [register_shrinker is vararg]) ],[ - struct shrinker cache_shrinker = { - .count_objects = shrinker_cb, - .scan_objects = shrinker_cb, - .seeks = DEFAULT_SEEKS, - }; - register_shrinker(&cache_shrinker); + AC_MSG_RESULT(no) ]) ]) @@ -144,75 +133,12 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_SHRINKER_REGISTER], [ ]) ]) -AC_DEFUN([ZFS_AC_KERNEL_SHRINKER_CALLBACK],[ - dnl # - dnl # 6.0 API change - dnl # register_shrinker() becomes a var-arg function that takes - dnl # a printf-style format string as args > 0 - dnl # - AC_MSG_CHECKING([whether new var-arg register_shrinker() exists]) - ZFS_LINUX_TEST_RESULT([register_shrinker_vararg], [ +AC_DEFUN([ZFS_AC_KERNEL_SHRINKER_REGISTER], [ + ZFS_LINUX_TEST_RESULT([shrinker_register], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_REGISTER_SHRINKER_VARARG, 1, - [register_shrinker is vararg]) - - dnl # We assume that the split shrinker callback exists if the - dnl # vararg register_shrinker() exists, because the latter is - dnl # a much more recent addition, and the macro test for the - dnl # var-arg version only works if the callback is split - AC_DEFINE(HAVE_SPLIT_SHRINKER_CALLBACK, 1, - [cs->count_objects exists]) - ],[ + AC_DEFINE(HAVE_SHRINKER_REGISTER, 1, [shrinker_register exists]) + ], [ AC_MSG_RESULT(no) - dnl # - dnl # 3.0 - 3.11 API change - dnl # cs->shrink(struct shrinker *, struct shrink_control *sc) - dnl # - AC_MSG_CHECKING([whether new 2-argument shrinker exists]) - ZFS_LINUX_TEST_RESULT([shrinker_cb_shrink_control], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_SINGLE_SHRINKER_CALLBACK, 1, - [new shrinker callback wants 2 args]) - ],[ - AC_MSG_RESULT(no) - - dnl # - dnl # 3.12 API change, - dnl # cs->shrink() is logically split in to - dnl # cs->count_objects() and cs->scan_objects() - dnl # - AC_MSG_CHECKING( - [whether cs->count_objects callback exists]) - ZFS_LINUX_TEST_RESULT( - [shrinker_cb_shrink_control_split],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_SPLIT_SHRINKER_CALLBACK, 1, - [cs->count_objects exists]) - ],[ - AC_MSG_RESULT(no) - - AC_MSG_CHECKING( - [whether shrinker_register exists]) - ZFS_LINUX_TEST_RESULT([shrinker_register], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_SHRINKER_REGISTER, 1, - [shrinker_register exists]) - - dnl # We assume that the split shrinker - dnl # callback exists if - dnl # shrinker_register() exists, - dnl # because the latter is a much more - dnl # recent addition, and the macro - dnl # test for shrinker_register() only - dnl # works if the callback is split - AC_DEFINE(HAVE_SPLIT_SHRINKER_CALLBACK, - 1, [cs->count_objects exists]) - ],[ - AC_MSG_RESULT(no) - ZFS_LINUX_TEST_ERROR([shrinker]) - ]) - ]) - ]) ]) ]) @@ -220,7 +146,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_SHRINKER], [ ZFS_AC_KERNEL_SRC_SUPER_BLOCK_S_SHRINK ZFS_AC_KERNEL_SRC_SUPER_BLOCK_S_SHRINK_PTR ZFS_AC_KERNEL_SRC_SHRINK_CONTROL_HAS_NID - ZFS_AC_KERNEL_SRC_SHRINKER_CALLBACK ZFS_AC_KERNEL_SRC_REGISTER_SHRINKER_VARARG ZFS_AC_KERNEL_SRC_SHRINKER_REGISTER ]) @@ -228,5 +153,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_SHRINKER], [ AC_DEFUN([ZFS_AC_KERNEL_SHRINKER], [ ZFS_AC_KERNEL_SUPER_BLOCK_S_SHRINK ZFS_AC_KERNEL_SHRINK_CONTROL_HAS_NID - ZFS_AC_KERNEL_SHRINKER_CALLBACK + ZFS_AC_KERNEL_REGISTER_SHRINKER_VARARG + ZFS_AC_KERNEL_SHRINKER_REGISTER ]) |