forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linux 5.17 compat: GENHD_FL_EXT_DEVT / GENHD_FL_NO_PART_SCAN
As of the 5.17 kernel the GENHD_FL_EXT_DEVT flag has been removed and the GENHD_FL_NO_PART_SCAN flag renamed GENHD_FL_NO_PART. Update zvol_alloc() to set GENHD_FL_NO_PART for the newer kernels which is sufficient. The behavior for prior kernels remains unchanged. 1ebe2e5f ("block: remove GENHD_FL_EXT_DEVT") 46e7eac6 ("block: rename GENHD_FL_NO_PART_SCAN to GENHD_FL_NO_PART") Reviewed-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#13294 Closes openzfs#13297
- Loading branch information
1 parent
d52e467
commit 8ecd68e
Showing
3 changed files
with
68 additions
and
13 deletions.
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,58 @@ | ||
dnl # | ||
dnl # 5.17 API change, | ||
dnl # | ||
dnl # GENHD_FL_EXT_DEVT flag removed | ||
dnl # GENHD_FL_NO_PART_SCAN renamed GENHD_FL_NO_PART | ||
dnl # | ||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GENHD_FLAGS], [ | ||
ZFS_LINUX_TEST_SRC([genhd_fl_ext_devt], [ | ||
#include <linux/blkdev.h> | ||
], [ | ||
int flags __attribute__ ((unused)) = GENHD_FL_EXT_DEVT; | ||
]) | ||
ZFS_LINUX_TEST_SRC([genhd_fl_no_part], [ | ||
#include <linux/blkdev.h> | ||
], [ | ||
int flags __attribute__ ((unused)) = GENHD_FL_NO_PART; | ||
]) | ||
ZFS_LINUX_TEST_SRC([genhd_fl_no_part_scan], [ | ||
#include <linux/blkdev.h> | ||
], [ | ||
int flags __attribute__ ((unused)) = GENHD_FL_NO_PART_SCAN; | ||
]) | ||
]) | ||
|
||
AC_DEFUN([ZFS_AC_KERNEL_GENHD_FLAGS], [ | ||
AC_MSG_CHECKING([whether GENHD_FL_EXT_DEVT flag is available]) | ||
ZFS_LINUX_TEST_RESULT([genhd_fl_ext_devt], [ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(ZFS_GENHD_FL_EXT_DEVT, GENHD_FL_EXT_DEVT, | ||
[GENHD_FL_EXT_DEVT flag is available]) | ||
], [ | ||
AC_MSG_RESULT(no) | ||
AC_DEFINE(ZFS_GENHD_FL_EXT_DEVT, 0, | ||
[GENHD_FL_EXT_DEVT flag is not available]) | ||
]) | ||
AC_MSG_CHECKING([whether GENHD_FL_NO_PART flag is available]) | ||
ZFS_LINUX_TEST_RESULT([genhd_fl_no_part], [ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(ZFS_GENHD_FL_NO_PART, GENHD_FL_NO_PART, | ||
[GENHD_FL_NO_PART flag is available]) | ||
], [ | ||
AC_MSG_RESULT(no) | ||
AC_MSG_CHECKING([whether GENHD_FL_NO_PART_SCAN flag is available]) | ||
ZFS_LINUX_TEST_RESULT([genhd_fl_no_part_scan], [ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(ZFS_GENHD_FL_NO_PART, GENHD_FL_NO_PART_SCAN, | ||
[GENHD_FL_NO_PART_SCAN flag is available]) | ||
], [ | ||
ZFS_LINUX_TEST_ERROR([GENHD_FL_NO_PART|GENHD_FL_NO_PART_SCAN]) | ||
]) | ||
]) | ||
]) |
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