]> git.proxmox.com Git - mirror_zfs-debian.git/blame - config/kernel-bdi-setup-and-register.m4
Imported Upstream version 0.6.2+git20140204
[mirror_zfs-debian.git] / config / kernel-bdi-setup-and-register.m4
CommitLineData
5547c2f1
BB
1dnl #
2dnl # 2.6.34 API change
a08ee875 3dnl # The bdi_setup_and_register() helper function is available and
5547c2f1
BB
4dnl # exported by the kernel. This is a trivial helper function but
5dnl # using it significantly simplifies the code surrounding setting
6dnl # up and tearing down the bdi structure.
7dnl #
70574182
ED
8AC_DEFUN([ZFS_AC_KERNEL_BDI_SETUP_AND_REGISTER],
9 [AC_MSG_CHECKING([whether bdi_setup_and_register() is available])
a08ee875
LG
10 tmp_flags="$EXTRA_KCFLAGS"
11 EXTRA_KCFLAGS="-Wno-unused-result"
70574182
ED
12 ZFS_LINUX_TRY_COMPILE_SYMBOL([
13 #include <linux/backing-dev.h>
14 ], [
15 bdi_setup_and_register(NULL, NULL, 0);
16 ], [bdi_setup_and_register], [mm/backing-dev.c], [
17 AC_MSG_RESULT(yes)
18 AC_DEFINE(HAVE_BDI_SETUP_AND_REGISTER, 1,
19 [bdi_setup_and_register() is available])
20 ], [
21 AC_MSG_RESULT(no)
22 ])
a08ee875 23 EXTRA_KCFLAGS="$tmp_flags"
5547c2f1 24])