aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2011-02-11 08:58:55 -0800
committerBrian Behlendorf <[email protected]>2011-02-11 09:05:51 -0800
commit7268e1bec8478639b7a1047e02ab931f30bc2f92 (patch)
treef3351407cbadd80f457d2d363541135865d82ebe /config
parent777d4af89137907adc91377327505f40c296035d (diff)
Linux 2.6.35 compat, fops->fsync()
The fsync() callback in the file_operations structure used to take 3 arguments. The callback now only takes 2 arguments because the dentry argument was determined to be unused by all consumers. To handle this a compatibility prototype was added to ensure the right prototype is used. Our implementation never used the dentry argument either so it's just a matter of using the right prototype.
Diffstat (limited to 'config')
-rw-r--r--config/kernel-fsync.m420
-rw-r--r--config/kernel.m41
2 files changed, 21 insertions, 0 deletions
diff --git a/config/kernel-fsync.m4 b/config/kernel-fsync.m4
new file mode 100644
index 000000000..2733dba33
--- /dev/null
+++ b/config/kernel-fsync.m4
@@ -0,0 +1,20 @@
+dnl #
+dnl # 2.6.35 API change
+dnl # The dentry argument was deamed unused and dropped in 2.6.36.
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_FSYNC_2ARGS], [
+ AC_MSG_CHECKING([whether fops->fsync() wants 2 args])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ ],[
+ int (*fsync) (struct file *, int datasync) = NULL;
+ struct file_operations fops;
+
+ fops.fsync = fsync;
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_2ARGS_FSYNC, 1, [fops->fsync() want 2 args])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
diff --git a/config/kernel.m4 b/config/kernel.m4
index d1ed54fba..c411c8f49 100644
--- a/config/kernel.m4
+++ b/config/kernel.m4
@@ -29,6 +29,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
ZFS_AC_KERNEL_RQ_IS_SYNC
ZFS_AC_KERNEL_RQ_FOR_EACH_SEGMENT
ZFS_AC_KERNEL_CONST_XATTR_HANDLER
+ ZFS_AC_KERNEL_FSYNC_2ARGS
if test "$LINUX_OBJ" != "$LINUX"; then
KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"