From cf006e349647f3263435e263071eb84f027d504d Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Sat, 3 Aug 2024 13:28:29 +1000 Subject: [PATCH] config: remove HAVE_GENERIC_WRITE_CHECKS_KIOCB Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf Reviewed-by: Tony Hutter Reviewed-by: Tino Reichardt Signed-off-by: Rob Norris Closes #16479 --- config/kernel-vfs-rw-iterate.m4 | 24 ------------------------ config/kernel.m4 | 2 -- module/os/linux/zfs/zpl_file.c | 12 ------------ 3 files changed, 38 deletions(-) diff --git a/config/kernel-vfs-rw-iterate.m4 b/config/kernel-vfs-rw-iterate.m4 index cb20ed030..7c568e94f 100644 --- a/config/kernel-vfs-rw-iterate.m4 +++ b/config/kernel-vfs-rw-iterate.m4 @@ -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 - ],[ - 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) - ]) -]) diff --git a/config/kernel.m4 b/config/kernel.m4 index d75c2915d..f9c98c818 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -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 diff --git a/module/os/linux/zfs/zpl_file.c b/module/os/linux/zfs/zpl_file.c index aff4f2fb1..428afac44 100644 --- a/module/os/linux/zfs/zpl_file.c +++ b/module/os/linux/zfs/zpl_file.c @@ -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); }