forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linux 5.10 compat: check_disk_change() removed
Kernel 5.10 removed check_disk_change() in favor of callers using the faster bdev_check_media_change() instead, and explicitly forcing bdev revalidation when they desire that behavior. To preserve prior behavior, I have wrapped this into a zfs_check_media_change() macro that calls an inline function for the new API that mimics the old behavior when check_disk_change() doesn't exist, and just calls check_disk_change() if it exists. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes openzfs#11085
- Loading branch information
1 parent
8c7d159
commit 26a3f3c
Showing
5 changed files
with
102 additions
and
2 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,62 @@ | ||
dnl # | ||
dnl # check_disk_change() was removed in 5.10 | ||
dnl # | ||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_CHECK_DISK_CHANGE], [ | ||
ZFS_LINUX_TEST_SRC([check_disk_change], [ | ||
#include <linux/fs.h> | ||
#include <linux/blkdev.h> | ||
], [ | ||
struct block_device *bdev = NULL; | ||
bool error; | ||
error = check_disk_change(bdev); | ||
]) | ||
]) | ||
|
||
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_CHECK_DISK_CHANGE], [ | ||
AC_MSG_CHECKING([whether check_disk_change() exists]) | ||
ZFS_LINUX_TEST_RESULT([check_disk_change], [ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(HAVE_CHECK_DISK_CHANGE, 1, | ||
[check_disk_change() exists]) | ||
], [ | ||
AC_MSG_RESULT(no) | ||
]) | ||
]) | ||
|
||
dnl # | ||
dnl # 5.10 API, check_disk_change() is removed, in favor of | ||
dnl # bdev_check_media_change(), which doesn't force revalidation | ||
dnl # | ||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_CHECK_MEDIA_CHANGE], [ | ||
ZFS_LINUX_TEST_SRC([bdev_check_media_change], [ | ||
#include <linux/fs.h> | ||
#include <linux/blkdev.h> | ||
], [ | ||
struct block_device *bdev = NULL; | ||
int error; | ||
error = bdev_check_media_change(bdev); | ||
]) | ||
]) | ||
|
||
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_BDEV_CHECK_MEDIA_CHANGE], [ | ||
AC_MSG_CHECKING([whether bdev_disk_changed() exists]) | ||
ZFS_LINUX_TEST_RESULT([bdev_check_media_change], [ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(HAVE_BDEV_CHECK_MEDIA_CHANGE, 1, | ||
[bdev_check_media_change() exists]) | ||
], [ | ||
AC_MSG_RESULT(no) | ||
]) | ||
]) | ||
|
||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_CHANGE], [ | ||
ZFS_AC_KERNEL_SRC_BLKDEV_CHECK_DISK_CHANGE | ||
ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_CHECK_MEDIA_CHANGE | ||
]) | ||
|
||
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_CHANGE], [ | ||
ZFS_AC_KERNEL_BLKDEV_CHECK_DISK_CHANGE | ||
ZFS_AC_KERNEL_BLKDEV_BDEV_CHECK_MEDIA_CHANGE | ||
]) |
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
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