aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2011-11-09 12:45:35 -0800
committerBrian Behlendorf <[email protected]>2011-11-09 19:36:21 -0800
commit0d0b523728b348b2d762fd9b27511ed9b138607b (patch)
tree0cce0407fbb877f06e6aba098d47f27c8084324f /config
parent12ff95ff579d0203790aff69632c7ab12ce56140 (diff)
Linux 3.1 compat, vfs_fsync()
Preferentially use the vfs_fsync() function. This function was initially introduced in 2.6.29 and took three arguments. As of 2.6.35 the dentry argument was dropped from the function. For older kernels fall back to using file_fsync() which also took three arguments including the dentry. Signed-off-by: Brian Behlendorf <[email protected]> Issue #52
Diffstat (limited to 'config')
-rw-r--r--config/spl-build.m428
1 files changed, 20 insertions, 8 deletions
diff --git a/config/spl-build.m4 b/config/spl-build.m4
index f5696b943..d0bd97cb4 100644
--- a/config/spl-build.m4
+++ b/config/spl-build.m4
@@ -68,13 +68,14 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
SPL_AC_2ARGS_SET_FS_PWD
SPL_AC_2ARGS_VFS_UNLINK
SPL_AC_4ARGS_VFS_RENAME
+ SPL_AC_VFS_FSYNC
+ SPL_AC_2ARGS_VFS_FSYNC
SPL_AC_FS_STRUCT_SPINLOCK
SPL_AC_CRED_STRUCT
SPL_AC_GROUPS_SEARCH
SPL_AC_PUT_TASK_STRUCT
SPL_AC_5ARGS_PROC_HANDLER
SPL_AC_KVASPRINTF
- SPL_AC_3ARGS_FILE_FSYNC
SPL_AC_EXPORTED_RWSEM_IS_LOCKED
SPL_AC_KERNEL_INVALIDATE_INODES
SPL_AC_KERNEL_2ARGS_INVALIDATE_INODES
@@ -1718,19 +1719,30 @@ AC_DEFUN([SPL_AC_KVASPRINTF], [
])
dnl #
+dnl # 2.6.29 API change,
+dnl # vfs_fsync() funcation added, prior to this use file_fsync().
+dnl #
+AC_DEFUN([SPL_AC_VFS_FSYNC], [
+ SPL_CHECK_SYMBOL_EXPORT(
+ [vfs_fsync],
+ [fs/sync.c],
+ [AC_DEFINE(HAVE_VFS_FSYNC, 1, [vfs_fsync() is available])],
+ [])
+])
+
+dnl #
dnl # 2.6.35 API change,
-dnl # Unused 'struct dentry *' removed from prototype.
+dnl # Unused 'struct dentry *' removed from vfs_fsync() prototype.
dnl #
-AC_DEFUN([SPL_AC_3ARGS_FILE_FSYNC], [
- AC_MSG_CHECKING([whether file_fsync() wants 3 args])
+AC_DEFUN([SPL_AC_2ARGS_VFS_FSYNC], [
+ AC_MSG_CHECKING([whether vfs_fsync() wants 2 args])
SPL_LINUX_TRY_COMPILE([
- #include <linux/buffer_head.h>
+ #include <linux/fs.h>
],[
- file_fsync(NULL, NULL, 0);
+ vfs_fsync(NULL, 0);
],[
AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_3ARGS_FILE_FSYNC, 1,
- [file_fsync() wants 3 args])
+ AC_DEFINE(HAVE_2ARGS_VFS_FSYNC, 1, [vfs_fsync() wants 2 args])
],[
AC_MSG_RESULT(no)
])