mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 01:51:00 +03:00
config: remove HAVE_GENERIC_WRITE_CHECKS_KIOCB
Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #16479
This commit is contained in:
parent
7af642af4d
commit
cf006e3496
@ -54,27 +54,3 @@ AC_DEFUN([ZFS_AC_KERNEL_VFS_RW_ITERATE], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Linux 4.1.x API
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_GENERIC_WRITE_CHECKS], [
|
||||
ZFS_LINUX_TEST_SRC([generic_write_checks], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
struct kiocb *iocb = NULL;
|
||||
struct iov_iter *iov = NULL;
|
||||
generic_write_checks(iocb, iov);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_VFS_GENERIC_WRITE_CHECKS], [
|
||||
AC_MSG_CHECKING([whether generic_write_checks() takes kiocb])
|
||||
ZFS_LINUX_TEST_RESULT([generic_write_checks], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GENERIC_WRITE_CHECKS_KIOCB, 1,
|
||||
[generic_write_checks() takes kiocb])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
@ -106,7 +106,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
||||
ZFS_AC_KERNEL_SRC_VFS_READPAGES
|
||||
ZFS_AC_KERNEL_SRC_VFS_SET_PAGE_DIRTY_NOBUFFERS
|
||||
ZFS_AC_KERNEL_SRC_VFS_RW_ITERATE
|
||||
ZFS_AC_KERNEL_SRC_VFS_GENERIC_WRITE_CHECKS
|
||||
ZFS_AC_KERNEL_SRC_VFS_IOV_ITER
|
||||
ZFS_AC_KERNEL_SRC_VFS_COPY_FILE_RANGE
|
||||
ZFS_AC_KERNEL_SRC_VFS_GENERIC_COPY_FILE_RANGE
|
||||
@ -251,7 +250,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
||||
ZFS_AC_KERNEL_VFS_READPAGES
|
||||
ZFS_AC_KERNEL_VFS_SET_PAGE_DIRTY_NOBUFFERS
|
||||
ZFS_AC_KERNEL_VFS_RW_ITERATE
|
||||
ZFS_AC_KERNEL_VFS_GENERIC_WRITE_CHECKS
|
||||
ZFS_AC_KERNEL_VFS_IOV_ITER
|
||||
ZFS_AC_KERNEL_VFS_COPY_FILE_RANGE
|
||||
ZFS_AC_KERNEL_VFS_GENERIC_COPY_FILE_RANGE
|
||||
|
@ -298,23 +298,11 @@ static inline ssize_t
|
||||
zpl_generic_write_checks(struct kiocb *kiocb, struct iov_iter *from,
|
||||
size_t *countp)
|
||||
{
|
||||
#ifdef HAVE_GENERIC_WRITE_CHECKS_KIOCB
|
||||
ssize_t ret = generic_write_checks(kiocb, from);
|
||||
if (ret <= 0)
|
||||
return (ret);
|
||||
|
||||
*countp = ret;
|
||||
#else
|
||||
struct file *file = kiocb->ki_filp;
|
||||
struct address_space *mapping = file->f_mapping;
|
||||
struct inode *ip = mapping->host;
|
||||
int isblk = S_ISBLK(ip->i_mode);
|
||||
|
||||
*countp = iov_iter_count(from);
|
||||
ssize_t ret = generic_write_checks(file, &kiocb->ki_pos, countp, isblk);
|
||||
if (ret)
|
||||
return (ret);
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user