]> granicus.if.org Git - zfs/commitdiff
Linux 5.2 compat: Fix config/kernel-shrink.m4 test failure
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sat, 25 May 2019 20:40:46 +0000 (05:40 +0900)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 25 May 2019 20:40:46 +0000 (13:40 -0700)
"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

config/kernel-shrink.m4

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