927 lines
26 KiB
Diff
927 lines
26 KiB
Diff
|
diff --git a/config/spl-build.m4 b/config/spl-build.m4
|
||
|
index c046db8..d0bd97c 100644
|
||
|
--- a/config/spl-build.m4
|
||
|
+++ b/config/spl-build.m4
|
||
|
@@ -68,19 +68,21 @@ 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
|
||
|
SPL_AC_SHRINK_DCACHE_MEMORY
|
||
|
SPL_AC_SHRINK_ICACHE_MEMORY
|
||
|
- SPL_AC_KERN_PATH_PARENT
|
||
|
+ SPL_AC_KERN_PATH_PARENT_HEADER
|
||
|
+ SPL_AC_KERN_PATH_PARENT_SYMBOL
|
||
|
SPL_AC_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE
|
||
|
SPL_AC_SHRINK_CONTROL_STRUCT
|
||
|
])
|
||
|
@@ -588,6 +590,30 @@ AC_DEFUN([SPL_CHECK_SYMBOL_EXPORT],
|
||
|
])
|
||
|
|
||
|
dnl #
|
||
|
+dnl # SPL_CHECK_SYMBOL_HEADER
|
||
|
+dnl # check if a symbol prototype is defined in listed headers.
|
||
|
+dnl #
|
||
|
+AC_DEFUN([SPL_CHECK_SYMBOL_HEADER], [
|
||
|
+ AC_MSG_CHECKING([whether symbol $1 exists in header])
|
||
|
+ header=0
|
||
|
+ for file in $3; do
|
||
|
+ grep -q "$2" "$LINUX/$file" 2>/dev/null
|
||
|
+ rc=$?
|
||
|
+ if test $rc -eq 0; then
|
||
|
+ header=1
|
||
|
+ break;
|
||
|
+ fi
|
||
|
+ done
|
||
|
+ if test $header -eq 0; then
|
||
|
+ AC_MSG_RESULT([no])
|
||
|
+ $5
|
||
|
+ else
|
||
|
+ AC_MSG_RESULT([yes])
|
||
|
+ $4
|
||
|
+ fi
|
||
|
+])
|
||
|
+
|
||
|
+dnl #
|
||
|
dnl # SPL_CHECK_HEADER
|
||
|
dnl # check whether header exists and define HAVE_$2_HEADER
|
||
|
dnl #
|
||
|
@@ -1693,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)
|
||
|
])
|
||
|
@@ -1809,11 +1846,27 @@ dnl # and the flags argument has been removed. The only behavior now
|
||
|
dnl # offered is that of LOOKUP_PARENT. The spl already always passed
|
||
|
dnl # this flag so dropping the flag does not impact us.
|
||
|
dnl #
|
||
|
-AC_DEFUN([SPL_AC_KERN_PATH_PARENT], [
|
||
|
+AC_DEFUN([SPL_AC_KERN_PATH_PARENT_HEADER], [
|
||
|
+ SPL_CHECK_SYMBOL_HEADER(
|
||
|
+ [kern_path_parent],
|
||
|
+ [int kern_path_parent(const char \*, struct nameidata \*)],
|
||
|
+ [include/linux/namei.h],
|
||
|
+ [AC_DEFINE(HAVE_KERN_PATH_PARENT_HEADER, 1,
|
||
|
+ [kern_path_parent() is available])],
|
||
|
+ [])
|
||
|
+])
|
||
|
+
|
||
|
+dnl #
|
||
|
+dnl # 3.1 API compat,
|
||
|
+dnl # The kern_path_parent() symbol is no longer exported by the kernel.
|
||
|
+dnl # However, it remains the prefered interface and since we still have
|
||
|
+dnl # access to the prototype we dynamically lookup the required address.
|
||
|
+dnl #
|
||
|
+AC_DEFUN([SPL_AC_KERN_PATH_PARENT_SYMBOL], [
|
||
|
SPL_CHECK_SYMBOL_EXPORT(
|
||
|
[kern_path_parent],
|
||
|
[fs/namei.c],
|
||
|
- [AC_DEFINE(HAVE_KERN_PATH_PARENT, 1,
|
||
|
+ [AC_DEFINE(HAVE_KERN_PATH_PARENT_SYMBOL, 1,
|
||
|
[kern_path_parent() is available])],
|
||
|
[])
|
||
|
])
|
||
|
diff --git a/configure b/configure
|
||
|
index 1369ca0..901a912 100755
|
||
|
--- a/configure
|
||
|
+++ b/configure
|
||
|
@@ -15067,6 +15067,112 @@ fi
|
||
|
|
||
|
|
||
|
|
||
|
+ { $as_echo "$as_me:$LINENO: checking whether symbol vfs_fsync is exported" >&5
|
||
|
+$as_echo_n "checking whether symbol vfs_fsync is exported... " >&6; }
|
||
|
+ grep -q -E '[[:space:]]vfs_fsync[[:space:]]' \
|
||
|
+ $LINUX_OBJ/Module*.symvers 2>/dev/null
|
||
|
+ rc=$?
|
||
|
+ if test $rc -ne 0; then
|
||
|
+ export=0
|
||
|
+ for file in fs/sync.c; do
|
||
|
+ grep -q -E "EXPORT_SYMBOL.*(vfs_fsync)" \
|
||
|
+ "$LINUX_OBJ/$file" 2>/dev/null
|
||
|
+ rc=$?
|
||
|
+ if test $rc -eq 0; then
|
||
|
+ export=1
|
||
|
+ break;
|
||
|
+ fi
|
||
|
+ done
|
||
|
+ if test $export -eq 0; then
|
||
|
+ { $as_echo "$as_me:$LINENO: result: no" >&5
|
||
|
+$as_echo "no" >&6; }
|
||
|
+
|
||
|
+ else
|
||
|
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
|
||
|
+$as_echo "yes" >&6; }
|
||
|
+
|
||
|
+cat >>confdefs.h <<\_ACEOF
|
||
|
+#define HAVE_VFS_FSYNC 1
|
||
|
+_ACEOF
|
||
|
+
|
||
|
+ fi
|
||
|
+ else
|
||
|
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
|
||
|
+$as_echo "yes" >&6; }
|
||
|
+
|
||
|
+cat >>confdefs.h <<\_ACEOF
|
||
|
+#define HAVE_VFS_FSYNC 1
|
||
|
+_ACEOF
|
||
|
+
|
||
|
+ fi
|
||
|
+
|
||
|
+
|
||
|
+
|
||
|
+ { $as_echo "$as_me:$LINENO: checking whether vfs_fsync() wants 2 args" >&5
|
||
|
+$as_echo_n "checking whether vfs_fsync() wants 2 args... " >&6; }
|
||
|
+
|
||
|
+
|
||
|
+cat confdefs.h - <<_ACEOF >conftest.c
|
||
|
+/* confdefs.h. */
|
||
|
+_ACEOF
|
||
|
+cat confdefs.h >>conftest.$ac_ext
|
||
|
+cat >>conftest.$ac_ext <<_ACEOF
|
||
|
+/* end confdefs.h. */
|
||
|
+
|
||
|
+
|
||
|
+ #include <linux/fs.h>
|
||
|
+
|
||
|
+int
|
||
|
+main (void)
|
||
|
+{
|
||
|
+
|
||
|
+ vfs_fsync(NULL, 0);
|
||
|
+
|
||
|
+ ;
|
||
|
+ return 0;
|
||
|
+}
|
||
|
+
|
||
|
+_ACEOF
|
||
|
+
|
||
|
+
|
||
|
+ rm -Rf build && mkdir -p build
|
||
|
+ echo "obj-m := conftest.o" >build/Makefile
|
||
|
+ if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build'
|
||
|
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||
|
+ (eval $ac_try) 2>&5
|
||
|
+ ac_status=$?
|
||
|
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||
|
+ (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o'
|
||
|
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||
|
+ (eval $ac_try) 2>&5
|
||
|
+ ac_status=$?
|
||
|
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||
|
+ (exit $ac_status); }; }; then
|
||
|
+
|
||
|
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
|
||
|
+$as_echo "yes" >&6; }
|
||
|
+
|
||
|
+cat >>confdefs.h <<\_ACEOF
|
||
|
+#define HAVE_2ARGS_VFS_FSYNC 1
|
||
|
+_ACEOF
|
||
|
+
|
||
|
+
|
||
|
+else
|
||
|
+ $as_echo "$as_me: failed program was:" >&5
|
||
|
+sed 's/^/| /' conftest.$ac_ext >&5
|
||
|
+
|
||
|
+ { $as_echo "$as_me:$LINENO: result: no" >&5
|
||
|
+$as_echo "no" >&6; }
|
||
|
+
|
||
|
+
|
||
|
+
|
||
|
+fi
|
||
|
+
|
||
|
+ rm -Rf build
|
||
|
+
|
||
|
+
|
||
|
+
|
||
|
+
|
||
|
{ $as_echo "$as_me:$LINENO: checking whether struct fs_struct uses spinlock_t" >&5
|
||
|
$as_echo_n "checking whether struct fs_struct uses spinlock_t... " >&6; }
|
||
|
tmp_flags="$EXTRA_KCFLAGS"
|
||
|
@@ -15391,71 +15497,6 @@ _ACEOF
|
||
|
|
||
|
|
||
|
|
||
|
- { $as_echo "$as_me:$LINENO: checking whether file_fsync() wants 3 args" >&5
|
||
|
-$as_echo_n "checking whether file_fsync() wants 3 args... " >&6; }
|
||
|
-
|
||
|
-
|
||
|
-cat confdefs.h - <<_ACEOF >conftest.c
|
||
|
-/* confdefs.h. */
|
||
|
-_ACEOF
|
||
|
-cat confdefs.h >>conftest.$ac_ext
|
||
|
-cat >>conftest.$ac_ext <<_ACEOF
|
||
|
-/* end confdefs.h. */
|
||
|
-
|
||
|
-
|
||
|
- #include <linux/buffer_head.h>
|
||
|
-
|
||
|
-int
|
||
|
-main (void)
|
||
|
-{
|
||
|
-
|
||
|
- file_fsync(NULL, NULL, 0);
|
||
|
-
|
||
|
- ;
|
||
|
- return 0;
|
||
|
-}
|
||
|
-
|
||
|
-_ACEOF
|
||
|
-
|
||
|
-
|
||
|
- rm -Rf build && mkdir -p build
|
||
|
- echo "obj-m := conftest.o" >build/Makefile
|
||
|
- if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build'
|
||
|
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||
|
- (eval $ac_try) 2>&5
|
||
|
- ac_status=$?
|
||
|
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||
|
- (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o'
|
||
|
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||
|
- (eval $ac_try) 2>&5
|
||
|
- ac_status=$?
|
||
|
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||
|
- (exit $ac_status); }; }; then
|
||
|
-
|
||
|
- { $as_echo "$as_me:$LINENO: result: yes" >&5
|
||
|
-$as_echo "yes" >&6; }
|
||
|
-
|
||
|
-cat >>confdefs.h <<\_ACEOF
|
||
|
-#define HAVE_3ARGS_FILE_FSYNC 1
|
||
|
-_ACEOF
|
||
|
-
|
||
|
-
|
||
|
-else
|
||
|
- $as_echo "$as_me: failed program was:" >&5
|
||
|
-sed 's/^/| /' conftest.$ac_ext >&5
|
||
|
-
|
||
|
- { $as_echo "$as_me:$LINENO: result: no" >&5
|
||
|
-$as_echo "no" >&6; }
|
||
|
-
|
||
|
-
|
||
|
-
|
||
|
-fi
|
||
|
-
|
||
|
- rm -Rf build
|
||
|
-
|
||
|
-
|
||
|
-
|
||
|
-
|
||
|
{ $as_echo "$as_me:$LINENO: checking whether symbol rwsem_is_locked is exported" >&5
|
||
|
$as_echo_n "checking whether symbol rwsem_is_locked is exported... " >&6; }
|
||
|
grep -q -E '[[:space:]]rwsem_is_locked[[:space:]]' \
|
||
|
@@ -15684,6 +15725,34 @@ _ACEOF
|
||
|
|
||
|
|
||
|
|
||
|
+
|
||
|
+ { $as_echo "$as_me:$LINENO: checking whether symbol kern_path_parent exists in header" >&5
|
||
|
+$as_echo_n "checking whether symbol kern_path_parent exists in header... " >&6; }
|
||
|
+ header=0
|
||
|
+ for file in include/linux/namei.h; do
|
||
|
+ grep -q "int kern_path_parent(const char \*, struct nameidata \*)" "$LINUX/$file" 2>/dev/null
|
||
|
+ rc=$?
|
||
|
+ if test $rc -eq 0; then
|
||
|
+ header=1
|
||
|
+ break;
|
||
|
+ fi
|
||
|
+ done
|
||
|
+ if test $header -eq 0; then
|
||
|
+ { $as_echo "$as_me:$LINENO: result: no" >&5
|
||
|
+$as_echo "no" >&6; }
|
||
|
+
|
||
|
+ else
|
||
|
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
|
||
|
+$as_echo "yes" >&6; }
|
||
|
+
|
||
|
+cat >>confdefs.h <<\_ACEOF
|
||
|
+#define HAVE_KERN_PATH_PARENT_HEADER 1
|
||
|
+_ACEOF
|
||
|
+
|
||
|
+ fi
|
||
|
+
|
||
|
+
|
||
|
+
|
||
|
{ $as_echo "$as_me:$LINENO: checking whether symbol kern_path_parent is exported" >&5
|
||
|
$as_echo_n "checking whether symbol kern_path_parent is exported... " >&6; }
|
||
|
grep -q -E '[[:space:]]kern_path_parent[[:space:]]' \
|
||
|
@@ -15709,7 +15778,7 @@ $as_echo "no" >&6; }
|
||
|
$as_echo "yes" >&6; }
|
||
|
|
||
|
cat >>confdefs.h <<\_ACEOF
|
||
|
-#define HAVE_KERN_PATH_PARENT 1
|
||
|
+#define HAVE_KERN_PATH_PARENT_SYMBOL 1
|
||
|
_ACEOF
|
||
|
|
||
|
fi
|
||
|
@@ -15718,7 +15787,7 @@ _ACEOF
|
||
|
$as_echo "yes" >&6; }
|
||
|
|
||
|
cat >>confdefs.h <<\_ACEOF
|
||
|
-#define HAVE_KERN_PATH_PARENT 1
|
||
|
+#define HAVE_KERN_PATH_PARENT_SYMBOL 1
|
||
|
_ACEOF
|
||
|
|
||
|
fi
|
||
|
@@ -19268,6 +19337,112 @@ fi
|
||
|
|
||
|
|
||
|
|
||
|
+ { $as_echo "$as_me:$LINENO: checking whether symbol vfs_fsync is exported" >&5
|
||
|
+$as_echo_n "checking whether symbol vfs_fsync is exported... " >&6; }
|
||
|
+ grep -q -E '[[:space:]]vfs_fsync[[:space:]]' \
|
||
|
+ $LINUX_OBJ/Module*.symvers 2>/dev/null
|
||
|
+ rc=$?
|
||
|
+ if test $rc -ne 0; then
|
||
|
+ export=0
|
||
|
+ for file in fs/sync.c; do
|
||
|
+ grep -q -E "EXPORT_SYMBOL.*(vfs_fsync)" \
|
||
|
+ "$LINUX_OBJ/$file" 2>/dev/null
|
||
|
+ rc=$?
|
||
|
+ if test $rc -eq 0; then
|
||
|
+ export=1
|
||
|
+ break;
|
||
|
+ fi
|
||
|
+ done
|
||
|
+ if test $export -eq 0; then
|
||
|
+ { $as_echo "$as_me:$LINENO: result: no" >&5
|
||
|
+$as_echo "no" >&6; }
|
||
|
+
|
||
|
+ else
|
||
|
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
|
||
|
+$as_echo "yes" >&6; }
|
||
|
+
|
||
|
+cat >>confdefs.h <<\_ACEOF
|
||
|
+#define HAVE_VFS_FSYNC 1
|
||
|
+_ACEOF
|
||
|
+
|
||
|
+ fi
|
||
|
+ else
|
||
|
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
|
||
|
+$as_echo "yes" >&6; }
|
||
|
+
|
||
|
+cat >>confdefs.h <<\_ACEOF
|
||
|
+#define HAVE_VFS_FSYNC 1
|
||
|
+_ACEOF
|
||
|
+
|
||
|
+ fi
|
||
|
+
|
||
|
+
|
||
|
+
|
||
|
+ { $as_echo "$as_me:$LINENO: checking whether vfs_fsync() wants 2 args" >&5
|
||
|
+$as_echo_n "checking whether vfs_fsync() wants 2 args... " >&6; }
|
||
|
+
|
||
|
+
|
||
|
+cat confdefs.h - <<_ACEOF >conftest.c
|
||
|
+/* confdefs.h. */
|
||
|
+_ACEOF
|
||
|
+cat confdefs.h >>conftest.$ac_ext
|
||
|
+cat >>conftest.$ac_ext <<_ACEOF
|
||
|
+/* end confdefs.h. */
|
||
|
+
|
||
|
+
|
||
|
+ #include <linux/fs.h>
|
||
|
+
|
||
|
+int
|
||
|
+main (void)
|
||
|
+{
|
||
|
+
|
||
|
+ vfs_fsync(NULL, 0);
|
||
|
+
|
||
|
+ ;
|
||
|
+ return 0;
|
||
|
+}
|
||
|
+
|
||
|
+_ACEOF
|
||
|
+
|
||
|
+
|
||
|
+ rm -Rf build && mkdir -p build
|
||
|
+ echo "obj-m := conftest.o" >build/Makefile
|
||
|
+ if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build'
|
||
|
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||
|
+ (eval $ac_try) 2>&5
|
||
|
+ ac_status=$?
|
||
|
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||
|
+ (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o'
|
||
|
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||
|
+ (eval $ac_try) 2>&5
|
||
|
+ ac_status=$?
|
||
|
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||
|
+ (exit $ac_status); }; }; then
|
||
|
+
|
||
|
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
|
||
|
+$as_echo "yes" >&6; }
|
||
|
+
|
||
|
+cat >>confdefs.h <<\_ACEOF
|
||
|
+#define HAVE_2ARGS_VFS_FSYNC 1
|
||
|
+_ACEOF
|
||
|
+
|
||
|
+
|
||
|
+else
|
||
|
+ $as_echo "$as_me: failed program was:" >&5
|
||
|
+sed 's/^/| /' conftest.$ac_ext >&5
|
||
|
+
|
||
|
+ { $as_echo "$as_me:$LINENO: result: no" >&5
|
||
|
+$as_echo "no" >&6; }
|
||
|
+
|
||
|
+
|
||
|
+
|
||
|
+fi
|
||
|
+
|
||
|
+ rm -Rf build
|
||
|
+
|
||
|
+
|
||
|
+
|
||
|
+
|
||
|
{ $as_echo "$as_me:$LINENO: checking whether struct fs_struct uses spinlock_t" >&5
|
||
|
$as_echo_n "checking whether struct fs_struct uses spinlock_t... " >&6; }
|
||
|
tmp_flags="$EXTRA_KCFLAGS"
|
||
|
@@ -19592,71 +19767,6 @@ _ACEOF
|
||
|
|
||
|
|
||
|
|
||
|
- { $as_echo "$as_me:$LINENO: checking whether file_fsync() wants 3 args" >&5
|
||
|
-$as_echo_n "checking whether file_fsync() wants 3 args... " >&6; }
|
||
|
-
|
||
|
-
|
||
|
-cat confdefs.h - <<_ACEOF >conftest.c
|
||
|
-/* confdefs.h. */
|
||
|
-_ACEOF
|
||
|
-cat confdefs.h >>conftest.$ac_ext
|
||
|
-cat >>conftest.$ac_ext <<_ACEOF
|
||
|
-/* end confdefs.h. */
|
||
|
-
|
||
|
-
|
||
|
- #include <linux/buffer_head.h>
|
||
|
-
|
||
|
-int
|
||
|
-main (void)
|
||
|
-{
|
||
|
-
|
||
|
- file_fsync(NULL, NULL, 0);
|
||
|
-
|
||
|
- ;
|
||
|
- return 0;
|
||
|
-}
|
||
|
-
|
||
|
-_ACEOF
|
||
|
-
|
||
|
-
|
||
|
- rm -Rf build && mkdir -p build
|
||
|
- echo "obj-m := conftest.o" >build/Makefile
|
||
|
- if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build'
|
||
|
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||
|
- (eval $ac_try) 2>&5
|
||
|
- ac_status=$?
|
||
|
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||
|
- (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o'
|
||
|
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||
|
- (eval $ac_try) 2>&5
|
||
|
- ac_status=$?
|
||
|
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||
|
- (exit $ac_status); }; }; then
|
||
|
-
|
||
|
- { $as_echo "$as_me:$LINENO: result: yes" >&5
|
||
|
-$as_echo "yes" >&6; }
|
||
|
-
|
||
|
-cat >>confdefs.h <<\_ACEOF
|
||
|
-#define HAVE_3ARGS_FILE_FSYNC 1
|
||
|
-_ACEOF
|
||
|
-
|
||
|
-
|
||
|
-else
|
||
|
- $as_echo "$as_me: failed program was:" >&5
|
||
|
-sed 's/^/| /' conftest.$ac_ext >&5
|
||
|
-
|
||
|
- { $as_echo "$as_me:$LINENO: result: no" >&5
|
||
|
-$as_echo "no" >&6; }
|
||
|
-
|
||
|
-
|
||
|
-
|
||
|
-fi
|
||
|
-
|
||
|
- rm -Rf build
|
||
|
-
|
||
|
-
|
||
|
-
|
||
|
-
|
||
|
{ $as_echo "$as_me:$LINENO: checking whether symbol rwsem_is_locked is exported" >&5
|
||
|
$as_echo_n "checking whether symbol rwsem_is_locked is exported... " >&6; }
|
||
|
grep -q -E '[[:space:]]rwsem_is_locked[[:space:]]' \
|
||
|
@@ -19885,6 +19995,34 @@ _ACEOF
|
||
|
|
||
|
|
||
|
|
||
|
+
|
||
|
+ { $as_echo "$as_me:$LINENO: checking whether symbol kern_path_parent exists in header" >&5
|
||
|
+$as_echo_n "checking whether symbol kern_path_parent exists in header... " >&6; }
|
||
|
+ header=0
|
||
|
+ for file in include/linux/namei.h; do
|
||
|
+ grep -q "int kern_path_parent(const char \*, struct nameidata \*)" "$LINUX/$file" 2>/dev/null
|
||
|
+ rc=$?
|
||
|
+ if test $rc -eq 0; then
|
||
|
+ header=1
|
||
|
+ break;
|
||
|
+ fi
|
||
|
+ done
|
||
|
+ if test $header -eq 0; then
|
||
|
+ { $as_echo "$as_me:$LINENO: result: no" >&5
|
||
|
+$as_echo "no" >&6; }
|
||
|
+
|
||
|
+ else
|
||
|
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
|
||
|
+$as_echo "yes" >&6; }
|
||
|
+
|
||
|
+cat >>confdefs.h <<\_ACEOF
|
||
|
+#define HAVE_KERN_PATH_PARENT_HEADER 1
|
||
|
+_ACEOF
|
||
|
+
|
||
|
+ fi
|
||
|
+
|
||
|
+
|
||
|
+
|
||
|
{ $as_echo "$as_me:$LINENO: checking whether symbol kern_path_parent is exported" >&5
|
||
|
$as_echo_n "checking whether symbol kern_path_parent is exported... " >&6; }
|
||
|
grep -q -E '[[:space:]]kern_path_parent[[:space:]]' \
|
||
|
@@ -19910,7 +20048,7 @@ $as_echo "no" >&6; }
|
||
|
$as_echo "yes" >&6; }
|
||
|
|
||
|
cat >>confdefs.h <<\_ACEOF
|
||
|
-#define HAVE_KERN_PATH_PARENT 1
|
||
|
+#define HAVE_KERN_PATH_PARENT_SYMBOL 1
|
||
|
_ACEOF
|
||
|
|
||
|
fi
|
||
|
@@ -19919,7 +20057,7 @@ _ACEOF
|
||
|
$as_echo "yes" >&6; }
|
||
|
|
||
|
cat >>confdefs.h <<\_ACEOF
|
||
|
-#define HAVE_KERN_PATH_PARENT 1
|
||
|
+#define HAVE_KERN_PATH_PARENT_SYMBOL 1
|
||
|
_ACEOF
|
||
|
|
||
|
fi
|
||
|
diff --git a/include/linux/file_compat.h b/include/linux/file_compat.h
|
||
|
index 97bd763..5c7833d 100644
|
||
|
--- a/include/linux/file_compat.h
|
||
|
+++ b/include/linux/file_compat.h
|
||
|
@@ -50,12 +50,16 @@ spl_filp_open(const char *name, int flags, int mode, int *err)
|
||
|
#define spl_filp_poff(f) (&(f)->f_pos)
|
||
|
#define spl_filp_write(fp, b, s, p) (fp)->f_op->write((fp), (b), (s), p)
|
||
|
|
||
|
-#ifdef HAVE_3ARGS_FILE_FSYNC
|
||
|
-#define spl_filp_fsync(fp, sync) (fp)->f_op->fsync((fp), \
|
||
|
- (fp)->f_dentry, sync)
|
||
|
+#ifdef HAVE_VFS_FSYNC
|
||
|
+# ifdef HAVE_2ARGS_VFS_FSYNC
|
||
|
+# define spl_filp_fsync(fp, sync) vfs_fsync(fp, sync)
|
||
|
+# else
|
||
|
+# define spl_filp_fsync(fp, sync) vfs_fsync(fp, (fp)->f_dentry, sync)
|
||
|
+# endif /* HAVE_2ARGS_VFS_FSYNC */
|
||
|
#else
|
||
|
-#define spl_filp_fsync(fp, sync) (fp)->f_op->fsync((fp), sync)
|
||
|
-#endif
|
||
|
+# include <linux/buffer_head.h>
|
||
|
+# define spl_filp_fsync(fp, sync) file_fsync(fp, (fp)->f_dentry, sync)
|
||
|
+#endif /* HAVE_VFS_FSYNC */
|
||
|
|
||
|
#ifdef HAVE_INODE_I_MUTEX
|
||
|
#define spl_inode_lock(ip) (mutex_lock(&(ip)->i_mutex))
|
||
|
@@ -67,11 +71,17 @@ spl_filp_open(const char *name, int flags, int mode, int *err)
|
||
|
#define spl_inode_unlock(ip) (up(&(ip)->i_sem))
|
||
|
#endif /* HAVE_INODE_I_MUTEX */
|
||
|
|
||
|
-#ifdef HAVE_KERN_PATH_PARENT
|
||
|
-#define spl_kern_path_parent(path, nd) kern_path_parent(path, nd)
|
||
|
+#ifdef HAVE_KERN_PATH_PARENT_HEADER
|
||
|
+# ifndef HAVE_KERN_PATH_PARENT_SYMBOL
|
||
|
+typedef int (*kern_path_parent_t)(const char *, struct nameidata *);
|
||
|
+extern kern_path_parent_t kern_path_parent_fn;
|
||
|
+# define spl_kern_path_parent(path, nd) kern_path_parent_fn(path, nd)
|
||
|
+# else
|
||
|
+# define spl_kern_path_parent(path, nd) kern_path_parent(path, nd)
|
||
|
+# endif /* HAVE_KERN_PATH_PARENT_SYMBOL */
|
||
|
#else
|
||
|
-#define spl_kern_path_parent(path, nd) path_lookup(path, LOOKUP_PARENT, nd)
|
||
|
-#endif /* HAVE_KERN_PATH_PARENT */
|
||
|
+# define spl_kern_path_parent(path, nd) path_lookup(path, LOOKUP_PARENT, nd)
|
||
|
+#endif /* HAVE_KERN_PATH_PARENT_HEADER */
|
||
|
|
||
|
#endif /* SPL_FILE_COMPAT_H */
|
||
|
|
||
|
diff --git a/include/linux/mm_compat.h b/include/linux/mm_compat.h
|
||
|
index 173acd4..b375f9b 100644
|
||
|
--- a/include/linux/mm_compat.h
|
||
|
+++ b/include/linux/mm_compat.h
|
||
|
@@ -93,16 +93,37 @@ extern shrink_dcache_memory_t shrink_dcache_memory_fn;
|
||
|
# define shrink_dcache_memory(nr, gfp) \
|
||
|
({ \
|
||
|
struct shrink_control sc = { .nr_to_scan = nr, .gfp_mask = gfp }; \
|
||
|
- shrink_dcache_memory_fn(NULL, &sc); \
|
||
|
+ int __ret__ = 0; \
|
||
|
+ \
|
||
|
+ if (shrink_dcache_memory_fn) \
|
||
|
+ __ret__ = shrink_dcache_memory_fn(NULL, &sc); \
|
||
|
+ \
|
||
|
+ __ret__; \
|
||
|
})
|
||
|
# elif defined(HAVE_3ARGS_SHRINKER_CALLBACK)
|
||
|
typedef int (*shrink_dcache_memory_t)(struct shrinker *, int, gfp_t);
|
||
|
extern shrink_dcache_memory_t shrink_dcache_memory_fn;
|
||
|
-# define shrink_dcache_memory(nr, gfp) shrink_dcache_memory_fn(NULL, nr, gfp)
|
||
|
+# define shrink_dcache_memory(nr, gfp) \
|
||
|
+({ \
|
||
|
+ int __ret__ = 0; \
|
||
|
+ \
|
||
|
+ if (shrink_dcache_memory_fn) \
|
||
|
+ __ret__ = shrink_dcache_memory_fn(NULL, nr, gfp); \
|
||
|
+ \
|
||
|
+ __ret__; \
|
||
|
+})
|
||
|
# else
|
||
|
typedef int (*shrink_dcache_memory_t)(int, gfp_t);
|
||
|
extern shrink_dcache_memory_t shrink_dcache_memory_fn;
|
||
|
-# define shrink_dcache_memory(nr, gfp) shrink_dcache_memory_fn(nr, gfp)
|
||
|
+# define shrink_dcache_memory(nr, gfp) \
|
||
|
+({ \
|
||
|
+ int __ret__ = 0; \
|
||
|
+ \
|
||
|
+ if (shrink_dcache_memory_fn) \
|
||
|
+ __ret__ = shrink_dcache_memory_fn(nr, gfp); \
|
||
|
+ \
|
||
|
+ __ret__; \
|
||
|
+})
|
||
|
# endif /* HAVE_3ARGS_SHRINKER_CALLBACK */
|
||
|
#endif /* HAVE_SHRINK_DCACHE_MEMORY */
|
||
|
|
||
|
@@ -120,16 +141,37 @@ extern shrink_icache_memory_t shrink_icache_memory_fn;
|
||
|
# define shrink_icache_memory(nr, gfp) \
|
||
|
({ \
|
||
|
struct shrink_control sc = { .nr_to_scan = nr, .gfp_mask = gfp }; \
|
||
|
- shrink_icache_memory_fn(NULL, &sc); \
|
||
|
+ int __ret__ = 0; \
|
||
|
+ \
|
||
|
+ if (shrink_icache_memory_fn) \
|
||
|
+ __ret__ = shrink_icache_memory_fn(NULL, &sc); \
|
||
|
+ \
|
||
|
+ __ret__; \
|
||
|
})
|
||
|
# elif defined(HAVE_3ARGS_SHRINKER_CALLBACK)
|
||
|
typedef int (*shrink_icache_memory_t)(struct shrinker *, int, gfp_t);
|
||
|
extern shrink_icache_memory_t shrink_icache_memory_fn;
|
||
|
-# define shrink_icache_memory(nr, gfp) shrink_icache_memory_fn(NULL, nr, gfp)
|
||
|
+# define shrink_icache_memory(nr, gfp) \
|
||
|
+({ \
|
||
|
+ int __ret__ = 0; \
|
||
|
+ \
|
||
|
+ if (shrink_icache_memory_fn) \
|
||
|
+ __ret__ = shrink_icache_memory_fn(NULL, nr, gfp); \
|
||
|
+ \
|
||
|
+ __ret__; \
|
||
|
+})
|
||
|
# else
|
||
|
typedef int (*shrink_icache_memory_t)(int, gfp_t);
|
||
|
extern shrink_icache_memory_t shrink_icache_memory_fn;
|
||
|
-# define shrink_icache_memory(nr, gfp) shrink_icache_memory_fn(nr, gfp)
|
||
|
+# define shrink_icache_memory(nr, gfp) \
|
||
|
+({ \
|
||
|
+ int __ret__ = 0; \
|
||
|
+ \
|
||
|
+ if (shrink_icache_memory_fn) \
|
||
|
+ __ret__ = shrink_icache_memory_fn(nr, gfp); \
|
||
|
+ \
|
||
|
+ __ret__; \
|
||
|
+})
|
||
|
# endif /* HAVE_3ARGS_SHRINKER_CALLBACK */
|
||
|
#endif /* HAVE_SHRINK_ICACHE_MEMORY */
|
||
|
|
||
|
diff --git a/include/sys/vnode.h b/include/sys/vnode.h
|
||
|
index 36605ca..03462bd 100644
|
||
|
--- a/include/sys/vnode.h
|
||
|
+++ b/include/sys/vnode.h
|
||
|
@@ -189,8 +189,9 @@ extern file_t *vn_getf(int fd);
|
||
|
extern void vn_releasef(int fd);
|
||
|
extern int vn_set_pwd(const char *filename);
|
||
|
|
||
|
-int vn_init(void);
|
||
|
-void vn_fini(void);
|
||
|
+int spl_vn_init_kallsyms_lookup(void);
|
||
|
+int spl_vn_init(void);
|
||
|
+void spl_vn_fini(void);
|
||
|
|
||
|
#define VOP_CLOSE vn_close
|
||
|
#define VOP_SEEK vn_seek
|
||
|
diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c
|
||
|
index 1dedf76..3f042cc 100644
|
||
|
--- a/module/spl/spl-generic.c
|
||
|
+++ b/module/spl/spl-generic.c
|
||
|
@@ -561,7 +561,7 @@ __init spl_init(void)
|
||
|
if ((rc = spl_taskq_init()))
|
||
|
SGOTO(out4, rc);
|
||
|
|
||
|
- if ((rc = vn_init()))
|
||
|
+ if ((rc = spl_vn_init()))
|
||
|
SGOTO(out5, rc);
|
||
|
|
||
|
if ((rc = proc_init()))
|
||
|
@@ -594,6 +594,9 @@ __init spl_init(void)
|
||
|
if ((rc = spl_kmem_init_kallsyms_lookup()))
|
||
|
SGOTO(out10, rc);
|
||
|
|
||
|
+ if ((rc = spl_vn_init_kallsyms_lookup()))
|
||
|
+ SGOTO(out10, rc);
|
||
|
+
|
||
|
printk(KERN_NOTICE "SPL: Loaded module v%s%s, using hostid 0x%08x\n",
|
||
|
SPL_META_VERSION, SPL_DEBUG_STR, (unsigned int) spl_hostid);
|
||
|
SRETURN(rc);
|
||
|
@@ -606,7 +609,7 @@ out8:
|
||
|
out7:
|
||
|
proc_fini();
|
||
|
out6:
|
||
|
- vn_fini();
|
||
|
+ spl_vn_fini();
|
||
|
out5:
|
||
|
spl_taskq_fini();
|
||
|
out4:
|
||
|
@@ -634,7 +637,7 @@ spl_fini(void)
|
||
|
tsd_fini();
|
||
|
kstat_fini();
|
||
|
proc_fini();
|
||
|
- vn_fini();
|
||
|
+ spl_vn_fini();
|
||
|
spl_taskq_fini();
|
||
|
spl_rw_fini();
|
||
|
spl_mutex_fini();
|
||
|
diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c
|
||
|
index b3c054a..1d2fa90 100644
|
||
|
--- a/module/spl/spl-kmem.c
|
||
|
+++ b/module/spl/spl-kmem.c
|
||
|
@@ -2123,21 +2123,15 @@ spl_kmem_init_kallsyms_lookup(void)
|
||
|
#endif /* HAVE_INVALIDATE_INODES */
|
||
|
|
||
|
#ifndef HAVE_SHRINK_DCACHE_MEMORY
|
||
|
+ /* When shrink_dcache_memory_fn == NULL support is disabled */
|
||
|
shrink_dcache_memory_fn = (shrink_dcache_memory_t)
|
||
|
- spl_kallsyms_lookup_name("shrink_dcache_memory");
|
||
|
- if (!shrink_dcache_memory_fn) {
|
||
|
- printk(KERN_ERR "Error: Unknown symbol shrink_dcache_memory\n");
|
||
|
- return -EFAULT;
|
||
|
- }
|
||
|
+ spl_kallsyms_lookup_name("shrink_dcache_memory");
|
||
|
#endif /* HAVE_SHRINK_DCACHE_MEMORY */
|
||
|
|
||
|
#ifndef HAVE_SHRINK_ICACHE_MEMORY
|
||
|
+ /* When shrink_icache_memory_fn == NULL support is disabled */
|
||
|
shrink_icache_memory_fn = (shrink_icache_memory_t)
|
||
|
- spl_kallsyms_lookup_name("shrink_icache_memory");
|
||
|
- if (!shrink_icache_memory_fn) {
|
||
|
- printk(KERN_ERR "Error: Unknown symbol shrink_icache_memory\n");
|
||
|
- return -EFAULT;
|
||
|
- }
|
||
|
+ spl_kallsyms_lookup_name("shrink_icache_memory");
|
||
|
#endif /* HAVE_SHRINK_ICACHE_MEMORY */
|
||
|
|
||
|
return 0;
|
||
|
diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c
|
||
|
index 354e879..cd0fa2c 100644
|
||
|
--- a/module/spl/spl-vnode.c
|
||
|
+++ b/module/spl/spl-vnode.c
|
||
|
@@ -42,6 +42,13 @@ static spl_kmem_cache_t *vn_file_cache;
|
||
|
static DEFINE_SPINLOCK(vn_file_lock);
|
||
|
static LIST_HEAD(vn_file_list);
|
||
|
|
||
|
+#ifdef HAVE_KERN_PATH_PARENT_HEADER
|
||
|
+#ifndef HAVE_KERN_PATH_PARENT_SYMBOL
|
||
|
+kern_path_parent_t kern_path_parent_fn = SYMBOL_POISON;
|
||
|
+EXPORT_SYMBOL(kern_path_parent_fn);
|
||
|
+#endif /* HAVE_KERN_PATH_PARENT_SYMBOL */
|
||
|
+#endif /* HAVE_KERN_PATH_PARENT_HEADER */
|
||
|
+
|
||
|
vtype_t
|
||
|
vn_mode_to_vtype(mode_t mode)
|
||
|
{
|
||
|
@@ -789,8 +796,24 @@ vn_file_cache_destructor(void *buf, void *cdrarg)
|
||
|
mutex_destroy(&fp->f_lock);
|
||
|
} /* vn_file_cache_destructor() */
|
||
|
|
||
|
+int spl_vn_init_kallsyms_lookup(void)
|
||
|
+{
|
||
|
+#ifdef HAVE_KERN_PATH_PARENT_HEADER
|
||
|
+#ifndef HAVE_KERN_PATH_PARENT_SYMBOL
|
||
|
+ kern_path_parent_fn = (kern_path_parent_t)
|
||
|
+ spl_kallsyms_lookup_name("kern_path_parent");
|
||
|
+ if (!kern_path_parent_fn) {
|
||
|
+ printk(KERN_ERR "Error: Unknown symbol kern_path_parent\n");
|
||
|
+ return -EFAULT;
|
||
|
+ }
|
||
|
+#endif /* HAVE_KERN_PATH_PARENT_SYMBOL */
|
||
|
+#endif /* HAVE_KERN_PATH_PARENT_HEADER */
|
||
|
+
|
||
|
+ return (0);
|
||
|
+}
|
||
|
+
|
||
|
int
|
||
|
-vn_init(void)
|
||
|
+spl_vn_init(void)
|
||
|
{
|
||
|
SENTRY;
|
||
|
vn_cache = kmem_cache_create("spl_vn_cache",
|
||
|
@@ -808,7 +831,7 @@ vn_init(void)
|
||
|
} /* vn_init() */
|
||
|
|
||
|
void
|
||
|
-vn_fini(void)
|
||
|
+spl_vn_fini(void)
|
||
|
{
|
||
|
file_t *fp, *next_fp;
|
||
|
int leaked = 0;
|
||
|
diff --git a/spl_config.h.in b/spl_config.h.in
|
||
|
index 97f0e06..08b4342 100644
|
||
|
--- a/spl_config.h.in
|
||
|
+++ b/spl_config.h.in
|
||
|
@@ -18,15 +18,15 @@
|
||
|
/* set_fs_pwd() wants 2 args */
|
||
|
#undef HAVE_2ARGS_SET_FS_PWD
|
||
|
|
||
|
+/* vfs_fsync() wants 2 args */
|
||
|
+#undef HAVE_2ARGS_VFS_FSYNC
|
||
|
+
|
||
|
/* vfs_unlink() wants 2 args */
|
||
|
#undef HAVE_2ARGS_VFS_UNLINK
|
||
|
|
||
|
/* zlib_deflate_workspacesize() wants 2 args */
|
||
|
#undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE
|
||
|
|
||
|
-/* file_fsync() wants 3 args */
|
||
|
-#undef HAVE_3ARGS_FILE_FSYNC
|
||
|
-
|
||
|
/* INIT_WORK wants 3 args */
|
||
|
#undef HAVE_3ARGS_INIT_WORK
|
||
|
|
||
|
@@ -115,7 +115,10 @@
|
||
|
#undef HAVE_KALLSYMS_LOOKUP_NAME
|
||
|
|
||
|
/* kern_path_parent() is available */
|
||
|
-#undef HAVE_KERN_PATH_PARENT
|
||
|
+#undef HAVE_KERN_PATH_PARENT_HEADER
|
||
|
+
|
||
|
+/* kern_path_parent() is available */
|
||
|
+#undef HAVE_KERN_PATH_PARENT_SYMBOL
|
||
|
|
||
|
/* kmalloc_node() is available */
|
||
|
#undef HAVE_KMALLOC_NODE
|
||
|
@@ -213,6 +216,9 @@
|
||
|
/* user_path_dir() is available */
|
||
|
#undef HAVE_USER_PATH_DIR
|
||
|
|
||
|
+/* vfs_fsync() is available */
|
||
|
+#undef HAVE_VFS_FSYNC
|
||
|
+
|
||
|
/* Page state NR_ACTIVE is available */
|
||
|
#undef HAVE_ZONE_STAT_ITEM_NR_ACTIVE
|
||
|
|