1dnl #
2dnl # 6.6 API change,
3dnl # fsync_bdev was removed in favor of sync_blockdev
4dnl #
5AC_DEFUN([ZFS_AC_KERNEL_SRC_SYNC_BDEV], [
6	ZFS_LINUX_TEST_SRC([fsync_bdev], [
7		#include <linux/blkdev.h>
8	],[
9		fsync_bdev(NULL);
10	])
11
12	ZFS_LINUX_TEST_SRC([sync_blockdev], [
13		#include <linux/blkdev.h>
14	],[
15		sync_blockdev(NULL);
16	])
17])
18
19AC_DEFUN([ZFS_AC_KERNEL_SYNC_BDEV], [
20	AC_MSG_CHECKING([whether fsync_bdev() exists])
21	ZFS_LINUX_TEST_RESULT([fsync_bdev], [
22		AC_MSG_RESULT(yes)
23		AC_DEFINE(HAVE_FSYNC_BDEV, 1,
24		    [fsync_bdev() is declared in include/blkdev.h])
25	],[
26		AC_MSG_CHECKING([whether sync_blockdev() exists])
27		ZFS_LINUX_TEST_RESULT([sync_blockdev], [
28			AC_MSG_RESULT(yes)
29			AC_DEFINE(HAVE_SYNC_BLOCKDEV, 1,
30			    [sync_blockdev() is declared in include/blkdev.h])
31		],[
32			ZFS_LINUX_TEST_ERROR(
33			    [neither fsync_bdev() nor sync_blockdev() exist])
34		])
35	])
36])
37