From 5547c2f1bf49802835fd6c52f15115ba344a2a8b Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 7 Nov 2011 16:39:03 -0800 Subject: Simplify BDI integration Update the code to use the bdi_setup_and_register() helper to simplify the bdi integration code. The updated code now just registers the bdi during mount and destroys it during unmount. The only complication is that for 2.6.32 - 2.6.33 kernels the helper wasn't available so in these cases the zfs code must provide it. Luckily the bdi_setup_and_register() function is trivial. Signed-off-by: Brian Behlendorf Closes #367 --- config/kernel-bdi-setup-and-register.m4 | 15 +++++++++++++++ config/kernel.m4 | 1 + 2 files changed, 16 insertions(+) create mode 100644 config/kernel-bdi-setup-and-register.m4 (limited to 'config') diff --git a/config/kernel-bdi-setup-and-register.m4 b/config/kernel-bdi-setup-and-register.m4 new file mode 100644 index 000000000..56fab8757 --- /dev/null +++ b/config/kernel-bdi-setup-and-register.m4 @@ -0,0 +1,15 @@ +dnl # +dnl # 2.6.34 API change +dnl # The bdi_setup_and_register() helper function is avilable and +dnl # exported by the kernel. This is a trivial helper function but +dnl # using it significantly simplifies the code surrounding setting +dnl # up and tearing down the bdi structure. +dnl # +AC_DEFUN([ZFS_AC_KERNEL_BDI_SETUP_AND_REGISTER], [ + ZFS_CHECK_SYMBOL_EXPORT( + [bdi_setup_and_register], + [mm/backing-dev.c], + [AC_DEFINE(HAVE_BDI_SETUP_AND_REGISTER, 1, + [bdi_setup_and_register() is available])], + []) +]) diff --git a/config/kernel.m4 b/config/kernel.m4 index 5490c8733..fec157a0c 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -41,6 +41,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ ZFS_AC_KERNEL_6ARGS_SECURITY_INODE_INIT_SECURITY ZFS_AC_KERNEL_MOUNT_NODEV ZFS_AC_KERNEL_BDI + ZFS_AC_KERNEL_BDI_SETUP_AND_REGISTER AS_IF([test "$LINUX_OBJ" != "$LINUX"], [ KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ" -- cgit v1.2.3