AC_MSG_RESULT(no)
])
])
+
+dnl #
+dnl # SLES API change, never adopted in mainline,
+dnl # Third 'struct vfsmount *' argument removed.
+dnl #
+AC_DEFUN([SPL_AC_2ARGS_VFS_UNLINK],
+ [AC_MSG_CHECKING([whether vfs_unlink() wants 2 args])
+ SPL_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ ],[
+ vfs_unlink(NULL, NULL);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_2ARGS_VFS_UNLINK, 1,
+ [vfs_unlink() wants 2 args])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
+
+dnl #
+dnl # SLES API change, never adopted in mainline,
+dnl # Third and sixth 'struct vfsmount *' argument removed.
+dnl #
+AC_DEFUN([SPL_AC_4ARGS_VFS_RENAME],
+ [AC_MSG_CHECKING([whether vfs_rename() wants 4 args])
+ SPL_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ ],[
+ vfs_rename(NULL, NULL, NULL, NULL);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_4ARGS_VFS_RENAME, 1,
+ [vfs_rename() wants 4 args])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
+fi
+
+ rm -Rf build
+
+
+
+echo "$as_me:$LINENO: checking whether vfs_unlink() wants 2 args" >&5
+echo $ECHO_N "checking whether vfs_unlink() wants 2 args... $ECHO_C" >&6
+
+
+cat >conftest.c <<_ACEOF
+/* 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_unlink(NULL, NULL);
+
+ ;
+ 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 LINUXINCLUDE="-Iinclude -Iinclude2 -I$LINUX/include -include include/linux/autoconf.h" -o tmp_include_depends -o scripts -o include/config/MARKER -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=$?
+ 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=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_2ARGS_VFS_UNLINK 1
+_ACEOF
+
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+
+
+fi
+
+ rm -Rf build
+
+
+
+echo "$as_me:$LINENO: checking whether vfs_rename() wants 4 args" >&5
+echo $ECHO_N "checking whether vfs_rename() wants 4 args... $ECHO_C" >&6
+
+
+cat >conftest.c <<_ACEOF
+/* 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_rename(NULL, NULL, NULL, NULL);
+
+ ;
+ 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 LINUXINCLUDE="-Iinclude -Iinclude2 -I$LINUX/include -include include/linux/autoconf.h" -o tmp_include_depends -o scripts -o include/config/MARKER -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=$?
+ 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=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_4ARGS_VFS_RENAME 1
+_ACEOF
+
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+
+
fi
rm -Rf build
SPL_AC_GET_ZONE_COUNTS
SPL_AC_GLOBAL_PAGE_STATE
SPL_AC_ZONE_STAT_ITEM_FIA
+SPL_AC_2ARGS_VFS_UNLINK
+SPL_AC_4ARGS_VFS_RENAME
AC_CONFIG_FILES([
Makefile
mutex_lock_nested(&nd.nd_dentry->d_inode->i_mutex, I_MUTEX_PARENT);
#else
down(&nd.nd_dentry->d_inode->i_sem);
-#endif
+#endif /* HAVE_INODE_I_MUTEX */
dentry = vn_lookup_hash(&nd);
rc = PTR_ERR(dentry);
if (!IS_ERR(dentry)) {
inode = dentry->d_inode;
if (inode)
atomic_inc(&inode->i_count);
+#ifdef HAVE_2ARGS_VFS_UNLINK
rc = vfs_unlink(nd.nd_dentry->d_inode, dentry);
+#else
+ rc = vfs_unlink(nd.nd_dentry->d_inode, dentry, nd.mnt);
+#endif /* HAVE_2ARGS_VFS_UNLINK */
exit2:
dput(dentry);
}
mutex_unlock(&nd.nd_dentry->d_inode->i_mutex);
#else
up(&nd.nd_dentry->d_inode->i_sem);
-#endif
+#endif /* HAVE_INODE_I_MUTEX */
if (inode)
iput(inode); /* truncate the inode here */
exit1:
int
vn_rename(const char *oldname, const char *newname, int x1)
{
- struct dentry * old_dir, * new_dir;
- struct dentry * old_dentry, *new_dentry;
- struct dentry * trap;
+ struct dentry *old_dir, *new_dir;
+ struct dentry *old_dentry, *new_dentry;
+ struct dentry *trap;
struct nameidata oldnd, newnd;
int rc = 0;
ENTRY;
if (new_dentry == trap)
GOTO(exit5, rc);
+#ifdef HAVE_4ARGS_VFS_RENAME
rc = vfs_rename(old_dir->d_inode, old_dentry,
new_dir->d_inode, new_dentry);
+#else
+ rc = vfs_rename(old_dir->d_inode, old_dentry, oldnd.mnt,
+ new_dir->d_inode, new_dentry, newnd.mnt);
+#endif /* HAVE_4ARGS_VFS_RENAME */
exit5:
dput(new_dentry);
exit4:
/* register_sysctl_table() wants 2 args */
#undef HAVE_2ARGS_REGISTER_SYSCTL
+/* vfs_unlink() wants 2 args */
+#undef HAVE_2ARGS_VFS_UNLINK
+
/* INIT_WORK wants 3 args */
#undef HAVE_3ARGS_INIT_WORK
/* on_each_cpu wants 3 args */
#undef HAVE_3ARGS_ON_EACH_CPU
+/* vfs_rename() wants 4 args */
+#undef HAVE_4ARGS_VFS_RENAME
+
/* device_create wants 5 args */
#undef HAVE_5ARGS_DEVICE_CREATE