aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorChunwei Chen <[email protected]>2016-10-19 11:19:01 -0700
committerBrian Behlendorf <[email protected]>2016-10-20 09:39:09 -0700
commitb8d9e26440ade0edebfa98af8cb9371810c1aeaf (patch)
treedd7131c9a6ed12367a4109568c7070ab8ebe89e2 /config
parent8ba3f2bf6a66378b36acd70e5616a78396030984 (diff)
Linux 4.9 compat: iops->rename() wants flags
In Linux 4.9, torvalds/linux@2773bf0, iops->rename() and iops->rename2() are merged together into iops->rename(), it now wants flags. Signed-off-by: Chunwei Chen <[email protected]>
Diffstat (limited to 'config')
-rw-r--r--config/kernel-rename.m425
-rw-r--r--config/kernel.m41
2 files changed, 26 insertions, 0 deletions
diff --git a/config/kernel-rename.m4 b/config/kernel-rename.m4
new file mode 100644
index 000000000..9f894fb4d
--- /dev/null
+++ b/config/kernel-rename.m4
@@ -0,0 +1,25 @@
+dnl #
+dnl # 4.9 API change,
+dnl # iops->rename2() merged into iops->rename(), and iops->rename() now wants
+dnl # flags.
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_RENAME_WANTS_FLAGS], [
+ AC_MSG_CHECKING([whether iops->rename() wants flags])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ int rename_fn(struct inode *sip, struct dentry *sdp,
+ struct inode *tip, struct dentry *tdp,
+ unsigned int flags) { return 0; }
+
+ static const struct inode_operations
+ iops __attribute__ ((unused)) = {
+ .rename = rename_fn,
+ };
+ ],[
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_RENAME_WANTS_FLAGS, 1, [iops->rename() wants flags])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
diff --git a/config/kernel.m4 b/config/kernel.m4
index c53e61157..37635256b 100644
--- a/config/kernel.m4
+++ b/config/kernel.m4
@@ -103,6 +103,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
ZFS_AC_KERNEL_FPU
ZFS_AC_KERNEL_KUID_HELPERS
ZFS_AC_KERNEL_MODULE_PARAM_CALL_CONST
+ ZFS_AC_KERNEL_RENAME_WANTS_FLAGS
AS_IF([test "$LINUX_OBJ" != "$LINUX"], [
KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"