summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2017-05-02 09:46:18 -0700
committerGitHub <[email protected]>2017-05-02 09:46:18 -0700
commit7dae2c81e7b2e68a596c5b431444be0fae308156 (patch)
tree7581727a7905b990c1f823592c47e9a0a50e1942 /config
parent153b2285545509c082be56dbf3ba5041de5d6e48 (diff)
Linux 4.12 compat: super_setup_bdi_name()
All filesystems were converted to dynamically allocated BDIs. The destruction of backing_dev_info structures is handled as part of super block destruction. Refactor the code to abstract away the details of creating and destroying a BDI. Reviewed-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #6089
Diffstat (limited to 'config')
-rw-r--r--config/kernel-bdi-setup-and-register.m438
-rw-r--r--config/kernel-bdi.m456
-rw-r--r--config/kernel.m42
3 files changed, 57 insertions, 39 deletions
diff --git a/config/kernel-bdi-setup-and-register.m4 b/config/kernel-bdi-setup-and-register.m4
deleted file mode 100644
index d1062e17e..000000000
--- a/config/kernel-bdi-setup-and-register.m4
+++ /dev/null
@@ -1,38 +0,0 @@
-dnl #
-dnl # 2.6.32 - 2.6.33, bdi_setup_and_register() is not exported.
-dnl # 2.6.34 - 3.19, bdi_setup_and_register() takes 3 arguments.
-dnl # 4.0 - x.y, bdi_setup_and_register() takes 2 arguments.
-dnl #
-AC_DEFUN([ZFS_AC_KERNEL_BDI_SETUP_AND_REGISTER], [
- AC_MSG_CHECKING([whether bdi_setup_and_register() wants 2 args])
- ZFS_LINUX_TRY_COMPILE_SYMBOL([
- #include <linux/backing-dev.h>
- struct backing_dev_info bdi;
- ], [
- char *name = "bdi";
- int error __attribute__((unused)) =
- bdi_setup_and_register(&bdi, name);
- ], [bdi_setup_and_register], [mm/backing-dev.c], [
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_2ARGS_BDI_SETUP_AND_REGISTER, 1,
- [bdi_setup_and_register() wants 2 args])
- ], [
- AC_MSG_RESULT(no)
- AC_MSG_CHECKING([whether bdi_setup_and_register() wants 3 args])
- ZFS_LINUX_TRY_COMPILE_SYMBOL([
- #include <linux/backing-dev.h>
- struct backing_dev_info bdi;
- ], [
- char *name = "bdi";
- unsigned int cap = BDI_CAP_MAP_COPY;
- int error __attribute__((unused)) =
- bdi_setup_and_register(&bdi, name, cap);
- ], [bdi_setup_and_register], [mm/backing-dev.c], [
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_3ARGS_BDI_SETUP_AND_REGISTER, 1,
- [bdi_setup_and_register() wants 3 args])
- ], [
- AC_MSG_RESULT(no)
- ])
- ])
-])
diff --git a/config/kernel-bdi.m4 b/config/kernel-bdi.m4
new file mode 100644
index 000000000..c2a9dd28b
--- /dev/null
+++ b/config/kernel-bdi.m4
@@ -0,0 +1,56 @@
+dnl #
+dnl # 2.6.32 - 2.6.33, bdi_setup_and_register() is not exported.
+dnl # 2.6.34 - 3.19, bdi_setup_and_register() takes 3 arguments.
+dnl # 4.0 - 4.11, bdi_setup_and_register() takes 2 arguments.
+dnl # 4.12 - x.y, super_setup_bdi_name() new interface.
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_BDI], [
+ AC_MSG_CHECKING([whether super_setup_bdi_name() exists])
+ ZFS_LINUX_TRY_COMPILE_SYMBOL([
+ #include <linux/fs.h>
+ struct super_block sb;
+ ], [
+ char *name = "bdi";
+ int error __attribute__((unused)) =
+ super_setup_bdi_name(&sb, name);
+ ], [super_setup_bdi_name], [fs/super.c], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SUPER_SETUP_BDI_NAME, 1,
+ [super_setup_bdi_name() exits])
+ ], [
+ AC_MSG_RESULT(no)
+ AC_MSG_CHECKING(
+ [whether bdi_setup_and_register() wants 2 args])
+ ZFS_LINUX_TRY_COMPILE_SYMBOL([
+ #include <linux/backing-dev.h>
+ struct backing_dev_info bdi;
+ ], [
+ char *name = "bdi";
+ int error __attribute__((unused)) =
+ bdi_setup_and_register(&bdi, name);
+ ], [bdi_setup_and_register], [mm/backing-dev.c], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_2ARGS_BDI_SETUP_AND_REGISTER, 1,
+ [bdi_setup_and_register() wants 2 args])
+ ], [
+ AC_MSG_RESULT(no)
+ AC_MSG_CHECKING(
+ [whether bdi_setup_and_register() wants 3 args])
+ ZFS_LINUX_TRY_COMPILE_SYMBOL([
+ #include <linux/backing-dev.h>
+ struct backing_dev_info bdi;
+ ], [
+ char *name = "bdi";
+ unsigned int cap = BDI_CAP_MAP_COPY;
+ int error __attribute__((unused)) =
+ bdi_setup_and_register(&bdi, name, cap);
+ ], [bdi_setup_and_register], [mm/backing-dev.c], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_3ARGS_BDI_SETUP_AND_REGISTER, 1,
+ [bdi_setup_and_register() wants 3 args])
+ ], [
+ AC_MSG_RESULT(no)
+ ])
+ ])
+ ])
+])
diff --git a/config/kernel.m4 b/config/kernel.m4
index 71c88aa36..638d9e143 100644
--- a/config/kernel.m4
+++ b/config/kernel.m4
@@ -100,7 +100,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
ZFS_AC_KERNEL_SHRINK_CONTROL_HAS_NID
ZFS_AC_KERNEL_S_INSTANCES_LIST_HEAD
ZFS_AC_KERNEL_S_D_OP
- ZFS_AC_KERNEL_BDI_SETUP_AND_REGISTER
+ ZFS_AC_KERNEL_BDI
ZFS_AC_KERNEL_SET_NLINK
ZFS_AC_KERNEL_ELEVATOR_CHANGE
ZFS_AC_KERNEL_5ARG_SGET