aboutsummaryrefslogtreecommitdiffstats
path: root/config/kernel-blkdev.m4
diff options
context:
space:
mode:
authorAmeer Hamza <[email protected]>2022-09-28 21:48:46 +0500
committerGitHub <[email protected]>2022-09-28 09:48:46 -0700
commit55c12724d377e6c7ace5b4bd42cd728d4a60af3e (patch)
treee5d28efce371d1097882dc064c16f362560e933e /config/kernel-blkdev.m4
parenteb9bec0a5d19abf9404f52081424fbb814e6188a (diff)
zed: mark disks as REMOVED when they are removed
ZED does not take any action for disk removal events if there is no spare VDEV available. Added zpool_vdev_remove_wanted() in libzfs and vdev_remove_wanted() in vdev.c to remove the VDEV through ZED on removal event. This means that if you are running zed and remove a disk, it will be properly marked as REMOVED. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Ameer Hamza <[email protected]> Closes #13797
Diffstat (limited to 'config/kernel-blkdev.m4')
-rw-r--r--config/kernel-blkdev.m455
1 files changed, 55 insertions, 0 deletions
diff --git a/config/kernel-blkdev.m4 b/config/kernel-blkdev.m4
index 462d6c6ef..28e536458 100644
--- a/config/kernel-blkdev.m4
+++ b/config/kernel-blkdev.m4
@@ -104,6 +104,57 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_CHECK_DISK_CHANGE], [
])
dnl #
+dnl # bdev_kobj() is introduced from 5.12
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_KOBJ], [
+ ZFS_LINUX_TEST_SRC([bdev_kobj], [
+ #include <linux/fs.h>
+ #include <linux/blkdev.h>
+ #include <linux/kobject.h>
+ ], [
+ struct block_device *bdev = NULL;
+ struct kobject *disk_kobj;
+ disk_kobj = bdev_kobj(bdev);
+ ])
+])
+
+AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_BDEV_KOBJ], [
+ AC_MSG_CHECKING([whether bdev_kobj() exists])
+ ZFS_LINUX_TEST_RESULT([bdev_kobj], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_BDEV_KOBJ, 1,
+ [bdev_kobj() exists])
+ ], [
+ AC_MSG_RESULT(no)
+ ])
+])
+
+dnl #
+dnl # part_to_dev() was removed in 5.12
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_PART_TO_DEV], [
+ ZFS_LINUX_TEST_SRC([part_to_dev], [
+ #include <linux/fs.h>
+ #include <linux/blkdev.h>
+ ], [
+ struct hd_struct *p = NULL;
+ struct device *pdev;
+ pdev = part_to_dev(p);
+ ])
+])
+
+AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_PART_TO_DEV], [
+ AC_MSG_CHECKING([whether part_to_dev() exists])
+ ZFS_LINUX_TEST_RESULT([part_to_dev], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_PART_TO_DEV, 1,
+ [part_to_dev() 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 #
@@ -405,6 +456,8 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV], [
ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_WHOLE
ZFS_AC_KERNEL_SRC_BLKDEV_BDEVNAME
ZFS_AC_KERNEL_SRC_BLKDEV_ISSUE_SECURE_ERASE
+ ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_KOBJ
+ ZFS_AC_KERNEL_SRC_BLKDEV_PART_TO_DEV
])
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV], [
@@ -421,4 +474,6 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV], [
ZFS_AC_KERNEL_BLKDEV_BDEVNAME
ZFS_AC_KERNEL_BLKDEV_GET_ERESTARTSYS
ZFS_AC_KERNEL_BLKDEV_ISSUE_SECURE_ERASE
+ ZFS_AC_KERNEL_BLKDEV_BDEV_KOBJ
+ ZFS_AC_KERNEL_BLKDEV_PART_TO_DEV
])