xref: /freebsd/sys/contrib/openzfs/config/kernel-revalidate-disk-size.m4 (revision 7ef62cebc2f965b0f640263e179276928885e33d)
1dnl #
2dnl # 5.11 API change
3dnl # revalidate_disk_size() has been removed entirely.
4dnl #
5dnl # 5.10 API change
6dnl # revalidate_disk() was replaced by revalidate_disk_size()
7dnl #
8AC_DEFUN([ZFS_AC_KERNEL_SRC_REVALIDATE_DISK], [
9
10	ZFS_LINUX_TEST_SRC([revalidate_disk_size], [
11		#include <linux/blkdev.h>
12	], [
13		struct gendisk *disk = NULL;
14		(void) revalidate_disk_size(disk, false);
15	])
16
17	ZFS_LINUX_TEST_SRC([revalidate_disk], [
18		#include <linux/blkdev.h>
19	], [
20		struct gendisk *disk = NULL;
21		(void) revalidate_disk(disk);
22	])
23])
24
25AC_DEFUN([ZFS_AC_KERNEL_REVALIDATE_DISK], [
26
27	AC_MSG_CHECKING([whether revalidate_disk_size() is available])
28	ZFS_LINUX_TEST_RESULT_SYMBOL([revalidate_disk_size],
29		[revalidate_disk_size], [block/genhd.c], [
30		AC_MSG_RESULT(yes)
31		AC_DEFINE(HAVE_REVALIDATE_DISK_SIZE, 1,
32		    [revalidate_disk_size() is available])
33	], [
34		AC_MSG_RESULT(no)
35
36		AC_MSG_CHECKING([whether revalidate_disk() is available])
37		ZFS_LINUX_TEST_RESULT_SYMBOL([revalidate_disk],
38		    [revalidate_disk], [block/genhd.c], [
39			AC_MSG_RESULT(yes)
40			AC_DEFINE(HAVE_REVALIDATE_DISK, 1,
41			    [revalidate_disk() is available])
42		], [
43			AC_MSG_RESULT(no)
44		])
45	])
46])
47