aboutsummaryrefslogtreecommitdiffstats
path: root/config/kernel-revalidate-disk-size.m4
diff options
context:
space:
mode:
authorColeman Kane <[email protected]>2020-10-18 13:06:18 -0400
committerBrian Behlendorf <[email protected]>2020-11-02 22:01:19 +0000
commit59b687232798a4da0e7647cca19a308aa82b5fad (patch)
treeec1d1b9fe333f9ac6c38686e4dfeb6c7ace39742 /config/kernel-revalidate-disk-size.m4
parentae15f1c1d88d85cc1af8152559d50a4baf5e50c5 (diff)
Linux 5.10 compat: revalidate_disk_size() added
A new function was added named revalidate_disk_size() and the old revalidate_disk() appears to have been deprecated. As the only ZFS code that calls this function is zvol_update_volsize, swapping the old function call out for the new one should be all that is required. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes #11085
Diffstat (limited to 'config/kernel-revalidate-disk-size.m4')
-rw-r--r--config/kernel-revalidate-disk-size.m424
1 files changed, 24 insertions, 0 deletions
diff --git a/config/kernel-revalidate-disk-size.m4 b/config/kernel-revalidate-disk-size.m4
new file mode 100644
index 000000000..de1146c10
--- /dev/null
+++ b/config/kernel-revalidate-disk-size.m4
@@ -0,0 +1,24 @@
+dnl #
+dnl # 5.10 API change
+dnl # revalidate_disk() was replaced by revalidate_disk_size()
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_SRC_REVALIDATE_DISK_SIZE], [
+ ZFS_LINUX_TEST_SRC([revalidate_disk_size], [
+ #include <linux/genhd.h>
+ ], [
+ struct gendisk *disk = NULL;
+ (void) revalidate_disk_size(disk, false);
+ ])
+])
+
+AC_DEFUN([ZFS_AC_KERNEL_REVALIDATE_DISK_SIZE], [
+ AC_MSG_CHECKING([whether revalidate_disk_size() is available])
+ ZFS_LINUX_TEST_RESULT_SYMBOL([revalidate_disk_size],
+ [revalidate_disk_size], [block/genhd.c], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_REVALIDATE_DISK_SIZE, 1,
+ [revalidate_disk_size() is available])
+ ], [
+ AC_MSG_RESULT(no)
+ ])
+])