forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linux 4.16 compat: get_disk_and_module()
As of torvalds/linux@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 openzfs#7264
- Loading branch information
1 parent
33e0901
commit a2ec500
Showing
4 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters