summaryrefslogtreecommitdiffstats
path: root/config/kernel-get-disk-and-module.m4
diff options
context:
space:
mode:
authorGiuseppe Di Natale <[email protected]>2018-03-05 12:44:35 -0800
committerBrian Behlendorf <[email protected]>2018-03-05 12:44:35 -0800
commitdd3e1e3083e6b80ac7cc4dabfbf9b5036b7a889d (patch)
tree8f0b49f470faf6fb9bc60440edbe3f4d7cfd5380 /config/kernel-get-disk-and-module.m4
parent80d52c3919b8cbf1cf21be07037335a22922440f (diff)
Linux 4.16 compat: get_disk_and_module()
As of https://github.com/torvalds/linux/commit/fb6d47a, get_disk() is now get_disk_and_module(). Add a configure check to determine if we need to use get_disk_and_module(). Reviewed-by: loli10K <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Giuseppe Di Natale <[email protected]> Closes #7264
Diffstat (limited to 'config/kernel-get-disk-and-module.m4')
-rw-r--r--config/kernel-get-disk-and-module.m419
1 files changed, 19 insertions, 0 deletions
diff --git a/config/kernel-get-disk-and-module.m4 b/config/kernel-get-disk-and-module.m4
new file mode 100644
index 000000000..2a51a5af7
--- /dev/null
+++ b/config/kernel-get-disk-and-module.m4
@@ -0,0 +1,19 @@
+dnl #
+dnl # 4.16 API change
+dnl # Verify if get_disk_and_module() symbol is available.
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_GET_DISK_AND_MODULE],
+ [AC_MSG_CHECKING([whether get_disk_and_module() is available])
+ ZFS_LINUX_TRY_COMPILE_SYMBOL([
+ #include <linux/genhd.h>
+ ], [
+ struct gendisk *disk = NULL;
+ (void) get_disk_and_module(disk);
+ ], [get_disk_and_module], [block/genhd.c], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_GET_DISK_AND_MODULE,
+ 1, [get_disk_and_module() is available])
+ ], [
+ AC_MSG_RESULT(no)
+ ])
+])