Linux 5.2 compat: Fix config/kernel-shrink.m4 test failure

"whether ->count_objects callback exists" test failed with
"error: error" message for using an incomplete function shrinker_cb().

This is caused by torvalds/linux@83da1bed86. It's configurable,
but we would want to be able to compile with default kbuild setting.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@osnexus.com>
Closes #8776
This commit is contained in:
Tomohiro Kusumi 2019-05-26 05:40:46 +09:00 committed by Brian Behlendorf
parent 8ec352be1f
commit a727f69e52

View File

@ -144,7 +144,9 @@ AC_DEFUN([ZFS_AC_KERNEL_SHRINKER_CALLBACK],[
ZFS_LINUX_TRY_COMPILE([ ZFS_LINUX_TRY_COMPILE([
#include <linux/mm.h> #include <linux/mm.h>
int shrinker_cb(int nr_to_scan, gfp_t gfp_mask); int shrinker_cb(int nr_to_scan, gfp_t gfp_mask) {
return 0;
}
],[ ],[
struct shrinker cache_shrinker = { struct shrinker cache_shrinker = {
.shrink = shrinker_cb, .shrink = shrinker_cb,
@ -166,8 +168,10 @@ AC_DEFUN([ZFS_AC_KERNEL_SHRINKER_CALLBACK],[
ZFS_LINUX_TRY_COMPILE([ ZFS_LINUX_TRY_COMPILE([
#include <linux/mm.h> #include <linux/mm.h>
int shrinker_cb(struct shrinker *, int nr_to_scan, int shrinker_cb(struct shrinker *shrink, int nr_to_scan,
gfp_t gfp_mask); gfp_t gfp_mask) {
return 0;
}
],[ ],[
struct shrinker cache_shrinker = { struct shrinker cache_shrinker = {
.shrink = shrinker_cb, .shrink = shrinker_cb,
@ -190,8 +194,10 @@ AC_DEFUN([ZFS_AC_KERNEL_SHRINKER_CALLBACK],[
ZFS_LINUX_TRY_COMPILE([ ZFS_LINUX_TRY_COMPILE([
#include <linux/mm.h> #include <linux/mm.h>
int shrinker_cb(struct shrinker *, int shrinker_cb(struct shrinker *shrink,
struct shrink_control *sc); struct shrink_control *sc) {
return 0;
}
],[ ],[
struct shrinker cache_shrinker = { struct shrinker cache_shrinker = {
.shrink = shrinker_cb, .shrink = shrinker_cb,
@ -215,8 +221,10 @@ AC_DEFUN([ZFS_AC_KERNEL_SHRINKER_CALLBACK],[
#include <linux/mm.h> #include <linux/mm.h>
unsigned long shrinker_cb( unsigned long shrinker_cb(
struct shrinker *, struct shrinker *shrink,
struct shrink_control *sc); struct shrink_control *sc) {
return 0;
}
],[ ],[
struct shrinker cache_shrinker = { struct shrinker cache_shrinker = {
.count_objects = shrinker_cb, .count_objects = shrinker_cb,