SLES10 Fixes (part 4):

- Configure check for SLES specific API change to vfs_unlink()
  and vfs_rename() which added a 'struct vfsmount *' argument.
  This was for something called the linux-security-module, but
  it appears that it was never adopted upstream.
This commit is contained in:
Brian Behlendorf 2009-05-20 11:31:55 -07:00
parent 6c9433c150
commit a093c6a499
5 changed files with 188 additions and 5 deletions

View File

@ -908,3 +908,41 @@ AC_DEFUN([SPL_AC_ZONE_STAT_ITEM_FIA], [
AC_MSG_RESULT(no) 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)
])
])

128
configure vendored
View File

@ -21081,6 +21081,134 @@ echo "${ECHO_T}no" >&6
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 fi
rm -Rf build rm -Rf build

View File

@ -79,6 +79,8 @@ SPL_AC_NEXT_ZONE
SPL_AC_GET_ZONE_COUNTS SPL_AC_GET_ZONE_COUNTS
SPL_AC_GLOBAL_PAGE_STATE SPL_AC_GLOBAL_PAGE_STATE
SPL_AC_ZONE_STAT_ITEM_FIA SPL_AC_ZONE_STAT_ITEM_FIA
SPL_AC_2ARGS_VFS_UNLINK
SPL_AC_4ARGS_VFS_RENAME
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile

View File

@ -290,7 +290,7 @@ vn_remove(const char *path, uio_seg_t seg, int flags)
mutex_lock_nested(&nd.nd_dentry->d_inode->i_mutex, I_MUTEX_PARENT); mutex_lock_nested(&nd.nd_dentry->d_inode->i_mutex, I_MUTEX_PARENT);
#else #else
down(&nd.nd_dentry->d_inode->i_sem); down(&nd.nd_dentry->d_inode->i_sem);
#endif #endif /* HAVE_INODE_I_MUTEX */
dentry = vn_lookup_hash(&nd); dentry = vn_lookup_hash(&nd);
rc = PTR_ERR(dentry); rc = PTR_ERR(dentry);
if (!IS_ERR(dentry)) { if (!IS_ERR(dentry)) {
@ -301,7 +301,11 @@ vn_remove(const char *path, uio_seg_t seg, int flags)
inode = dentry->d_inode; inode = dentry->d_inode;
if (inode) if (inode)
atomic_inc(&inode->i_count); atomic_inc(&inode->i_count);
#ifdef HAVE_2ARGS_VFS_UNLINK
rc = vfs_unlink(nd.nd_dentry->d_inode, dentry); 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: exit2:
dput(dentry); dput(dentry);
} }
@ -309,7 +313,7 @@ exit2:
mutex_unlock(&nd.nd_dentry->d_inode->i_mutex); mutex_unlock(&nd.nd_dentry->d_inode->i_mutex);
#else #else
up(&nd.nd_dentry->d_inode->i_sem); up(&nd.nd_dentry->d_inode->i_sem);
#endif #endif /* HAVE_INODE_I_MUTEX */
if (inode) if (inode)
iput(inode); /* truncate the inode here */ iput(inode); /* truncate the inode here */
exit1: exit1:
@ -393,8 +397,13 @@ vn_rename(const char *oldname, const char *newname, int x1)
if (new_dentry == trap) if (new_dentry == trap)
GOTO(exit5, rc); GOTO(exit5, rc);
#ifdef HAVE_4ARGS_VFS_RENAME
rc = vfs_rename(old_dir->d_inode, old_dentry, rc = vfs_rename(old_dir->d_inode, old_dentry,
new_dir->d_inode, new_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: exit5:
dput(new_dentry); dput(new_dentry);
exit4: exit4:

View File

@ -15,12 +15,18 @@
/* register_sysctl_table() wants 2 args */ /* register_sysctl_table() wants 2 args */
#undef HAVE_2ARGS_REGISTER_SYSCTL #undef HAVE_2ARGS_REGISTER_SYSCTL
/* vfs_unlink() wants 2 args */
#undef HAVE_2ARGS_VFS_UNLINK
/* INIT_WORK wants 3 args */ /* INIT_WORK wants 3 args */
#undef HAVE_3ARGS_INIT_WORK #undef HAVE_3ARGS_INIT_WORK
/* on_each_cpu wants 3 args */ /* on_each_cpu wants 3 args */
#undef HAVE_3ARGS_ON_EACH_CPU #undef HAVE_3ARGS_ON_EACH_CPU
/* vfs_rename() wants 4 args */
#undef HAVE_4ARGS_VFS_RENAME
/* device_create wants 5 args */ /* device_create wants 5 args */
#undef HAVE_5ARGS_DEVICE_CREATE #undef HAVE_5ARGS_DEVICE_CREATE