2 dnl # Check available BDI interfaces.
4 AC_DEFUN([ZFS_AC_KERNEL_SRC_BDI], [
5 ZFS_LINUX_TEST_SRC([super_setup_bdi_name], [
10 atomic_long_t zfs_bdi_seq;
11 int error __attribute__((unused));
12 atomic_long_set(&zfs_bdi_seq, 0);
14 super_setup_bdi_name(&sb, "%.28s-%ld", name,
15 atomic_long_inc_return(&zfs_bdi_seq));
18 ZFS_LINUX_TEST_SRC([bdi_setup_and_register], [
19 #include <linux/backing-dev.h>
20 struct backing_dev_info bdi;
23 int error __attribute__((unused)) =
24 bdi_setup_and_register(&bdi, name);
27 ZFS_LINUX_TEST_SRC([bdi_setup_and_register_3args], [
28 #include <linux/backing-dev.h>
29 struct backing_dev_info bdi;
32 unsigned int cap = BDI_CAP_MAP_COPY;
33 int error __attribute__((unused)) =
34 bdi_setup_and_register(&bdi, name, cap);
38 AC_DEFUN([ZFS_AC_KERNEL_BDI], [
40 dnl # 4.12, super_setup_bdi_name() introduced.
42 AC_MSG_CHECKING([whether super_setup_bdi_name() exists])
43 ZFS_LINUX_TEST_RESULT_SYMBOL([super_setup_bdi_name],
44 [super_setup_bdi_name], [fs/super.c], [
46 AC_DEFINE(HAVE_SUPER_SETUP_BDI_NAME, 1,
47 [super_setup_bdi_name() exits])
52 dnl # 4.0 - 4.11, bdi_setup_and_register() takes 2 arguments.
55 [whether bdi_setup_and_register() wants 2 args])
56 ZFS_LINUX_TEST_RESULT_SYMBOL([bdi_setup_and_register],
57 [bdi_setup_and_register], [mm/backing-dev.c], [
59 AC_DEFINE(HAVE_2ARGS_BDI_SETUP_AND_REGISTER, 1,
60 [bdi_setup_and_register() wants 2 args])
65 dnl # 2.6.34 - 3.19, bdi_setup_and_register()
66 dnl # takes 3 arguments.
69 [whether bdi_setup_and_register() wants 3 args])
70 ZFS_LINUX_TEST_RESULT_SYMBOL(
71 [bdi_setup_and_register_3args],
72 [bdi_setup_and_register], [mm/backing-dev.c], [
74 AC_DEFINE(HAVE_3ARGS_BDI_SETUP_AND_REGISTER, 1,
75 [bdi_setup_and_register() wants 3 args])
77 ZFS_LINUX_TEST_ERROR([bdi_setup])