mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 18:11:00 +03:00
Linux 3.13 compat: Pass NULL for new delegated inode argument
This check was originally added for SLES10, a093c6a
, to check for
a 'struct vfsmount *' argument which they added. However, since
SLES10 is based on a 2.6.16 kernel which is no longer supported
this functionality was dropped. The checks were refactored to
support Linux 3.13 without concern for historical versions.
Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #312
This commit is contained in:
parent
3e96de17d7
commit
50a0749eba
@ -1842,41 +1842,73 @@ AC_DEFUN([SPL_AC_SET_FS_PWD_WITH_CONST],
|
||||
EXTRA_KCFLAGS="$tmp_flags"
|
||||
])
|
||||
|
||||
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);
|
||||
vfs_unlink((struct inode *) NULL, (struct dentry *) NULL);
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_2ARGS_VFS_UNLINK, 1,
|
||||
[vfs_unlink() wants 2 args])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
dnl #
|
||||
dnl # Linux 3.13 API change
|
||||
dnl # Added delegated inode
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether vfs_unlink() wants 3 args])
|
||||
SPL_LINUX_TRY_COMPILE([
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
vfs_unlink((struct inode *) NULL,
|
||||
(struct dentry *) NULL,
|
||||
(struct inode **) NULL);
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_3ARGS_VFS_UNLINK, 1,
|
||||
[vfs_unlink() wants 3 args])
|
||||
],[
|
||||
AC_MSG_ERROR(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);
|
||||
vfs_rename((struct inode *) NULL, (struct dentry *) NULL,
|
||||
(struct inode *) NULL, (struct dentry *) NULL);
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_4ARGS_VFS_RENAME, 1,
|
||||
[vfs_rename() wants 4 args])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
dnl #
|
||||
dnl # Linux 3.13 API change
|
||||
dnl # Added delegated inode
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether vfs_rename() wants 5 args])
|
||||
SPL_LINUX_TRY_COMPILE([
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
vfs_rename((struct inode *) NULL,
|
||||
(struct dentry *) NULL,
|
||||
(struct inode *) NULL,
|
||||
(struct dentry *) NULL,
|
||||
(struct inode **) NULL);
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_5ARGS_VFS_RENAME, 1,
|
||||
[vfs_rename() wants 5 args])
|
||||
],[
|
||||
AC_MSG_ERROR(no)
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
|
@ -334,7 +334,11 @@ vn_remove(const char *path, uio_seg_t seg, int flags)
|
||||
if (inode)
|
||||
ihold(inode);
|
||||
|
||||
#ifdef HAVE_2ARGS_VFS_UNLINK
|
||||
rc = vfs_unlink(parent.dentry->d_inode, dentry);
|
||||
#else
|
||||
rc = vfs_unlink(parent.dentry->d_inode, dentry, NULL);
|
||||
#endif /* HAVE_2ARGS_VFS_UNLINK */
|
||||
exit1:
|
||||
dput(dentry);
|
||||
} else {
|
||||
@ -414,8 +418,8 @@ vn_rename(const char *oldname, const char *newname, int x1)
|
||||
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.nd_mnt,
|
||||
new_dir->d_inode, new_dentry, newnd.nd_mnt);
|
||||
rc = vfs_rename(old_dir->d_inode, old_dentry,
|
||||
new_dir->d_inode, new_dentry, NULL);
|
||||
#endif /* HAVE_4ARGS_VFS_RENAME */
|
||||
exit4:
|
||||
unlock_rename(new_dir, old_dir);
|
||||
@ -480,7 +484,7 @@ vn_remove(const char *path, uio_seg_t seg, int flags)
|
||||
#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.nd_mnt);
|
||||
rc = vfs_unlink(nd.nd_dentry->d_inode, dentry, NULL);
|
||||
#endif /* HAVE_2ARGS_VFS_UNLINK */
|
||||
exit2:
|
||||
dput(dentry);
|
||||
@ -574,8 +578,8 @@ vn_rename(const char *oldname, const char *newname, int x1)
|
||||
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.nd_mnt,
|
||||
new_dir->d_inode, new_dentry, newnd.nd_mnt);
|
||||
rc = vfs_rename(old_dir->d_inode, old_dentry,
|
||||
new_dir->d_inode, new_dentry, NULL);
|
||||
#endif /* HAVE_4ARGS_VFS_RENAME */
|
||||
exit5:
|
||||
dput(new_dentry);
|
||||
|
Loading…
Reference in New Issue
Block a user