aboutsummaryrefslogtreecommitdiffstats
path: root/config/kernel-revalidate-disk-size.m4
blob: 13cb92a174e3e4f2e4f956044524fd70ee51acc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
dnl #
dnl # 5.11 API change
dnl # revalidate_disk_size() has been removed entirely.
dnl #
dnl # 5.10 API change
dnl # revalidate_disk() was replaced by revalidate_disk_size()
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_REVALIDATE_DISK], [

	ZFS_LINUX_TEST_SRC([revalidate_disk_size], [
		#include <linux/blkdev.h>
	], [
		struct gendisk *disk = NULL;
		(void) revalidate_disk_size(disk, false);
	])

	ZFS_LINUX_TEST_SRC([revalidate_disk], [
		#include <linux/blkdev.h>
	], [
		struct gendisk *disk = NULL;
		(void) revalidate_disk(disk);
	])
])

AC_DEFUN([ZFS_AC_KERNEL_REVALIDATE_DISK], [

	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)

		AC_MSG_CHECKING([whether revalidate_disk() is available])
		ZFS_LINUX_TEST_RESULT_SYMBOL([revalidate_disk],
		    [revalidate_disk], [block/genhd.c], [
			AC_MSG_RESULT(yes)
			AC_DEFINE(HAVE_REVALIDATE_DISK, 1,
			    [revalidate_disk() is available])
		], [
			AC_MSG_RESULT(no)
		])
	])
])