mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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 <ezomori.nozomu@gmail.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov> Closes #7264
This commit is contained in:
committed by
Tony Hutter
parent
6dc40e2ada
commit
8d7f17798d
@@ -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)
|
||||
])
|
||||
])
|
||||
@@ -40,6 +40,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_MAX_SEGMENTS
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_HAVE_BIO_RW_UNPLUG
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_HAVE_BLK_PLUG
|
||||
ZFS_AC_KERNEL_GET_DISK_AND_MODULE
|
||||
ZFS_AC_KERNEL_GET_DISK_RO
|
||||
ZFS_AC_KERNEL_GET_GENDISK
|
||||
ZFS_AC_KERNEL_HAVE_BIO_SET_OP_ATTRS
|
||||
|
||||
Reference in New Issue
Block a user