diff options
author | Rob Norris <[email protected]> | 2024-08-05 19:53:26 +1000 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2024-09-18 11:23:50 -0700 |
commit | 230bc538cb56a2d605ca6d916cdd0a134b8a56d1 (patch) | |
tree | 09a5b575927f2b171ef08b34be8a9a61c4227eec | |
parent | 9914684d361ee5393d858b4da577037bec50a57c (diff) |
config: remove HAVE_VFS_FILE_OPERATIONS_EXTEND
Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Tino Reichardt <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
Closes #16479
-rw-r--r-- | config/kernel-vfs-extended-file_range.m4 | 50 | ||||
-rw-r--r-- | config/kernel.m4 | 2 | ||||
-rw-r--r-- | include/os/linux/zfs/sys/zpl.h | 4 | ||||
-rw-r--r-- | module/os/linux/zfs/zfs_vfsops.c | 6 | ||||
-rw-r--r-- | module/os/linux/zfs/zfs_znode.c | 8 | ||||
-rw-r--r-- | module/os/linux/zfs/zpl_file.c | 10 | ||||
-rw-r--r-- | module/os/linux/zfs/zpl_file_range.c | 10 |
7 files changed, 4 insertions, 86 deletions
diff --git a/config/kernel-vfs-extended-file_range.m4 b/config/kernel-vfs-extended-file_range.m4 deleted file mode 100644 index a26223131..000000000 --- a/config/kernel-vfs-extended-file_range.m4 +++ /dev/null @@ -1,50 +0,0 @@ -dnl # -dnl # EL7 have backported copy_file_range and clone_file_range and -dnl # added them to an "extended" file_operations struct. -dnl # -dnl # We're testing for both functions in one here, because they will only -dnl # ever appear together and we don't want to match a similar method in -dnl # some future vendor kernel. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_FILE_OPERATIONS_EXTEND], [ - ZFS_LINUX_TEST_SRC([vfs_file_operations_extend], [ - #include <linux/fs.h> - - static ssize_t test_copy_file_range(struct file *src_file, - loff_t src_off, struct file *dst_file, loff_t dst_off, - size_t len, unsigned int flags) { - (void) src_file; (void) src_off; - (void) dst_file; (void) dst_off; - (void) len; (void) flags; - return (0); - } - - static int test_clone_file_range(struct file *src_file, - loff_t src_off, struct file *dst_file, loff_t dst_off, - u64 len) { - (void) src_file; (void) src_off; - (void) dst_file; (void) dst_off; - (void) len; - return (0); - } - - static const struct file_operations_extend - fops __attribute__ ((unused)) = { - .kabi_fops = {}, - .copy_file_range = test_copy_file_range, - .clone_file_range = test_clone_file_range, - }; - ],[]) -]) -AC_DEFUN([ZFS_AC_KERNEL_VFS_FILE_OPERATIONS_EXTEND], [ - AC_MSG_CHECKING([whether file_operations_extend takes \ -.copy_file_range() and .clone_file_range()]) - ZFS_LINUX_TEST_RESULT([vfs_file_operations_extend], [ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_VFS_FILE_OPERATIONS_EXTEND, 1, - [file_operations_extend takes .copy_file_range() - and .clone_file_range()]) - ],[ - AC_MSG_RESULT([no]) - ]) -]) diff --git a/config/kernel.m4 b/config/kernel.m4 index 6f5954649..8769524fa 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -109,7 +109,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [ ZFS_AC_KERNEL_SRC_VFS_REMAP_FILE_RANGE ZFS_AC_KERNEL_SRC_VFS_CLONE_FILE_RANGE ZFS_AC_KERNEL_SRC_VFS_DEDUPE_FILE_RANGE - ZFS_AC_KERNEL_SRC_VFS_FILE_OPERATIONS_EXTEND ZFS_AC_KERNEL_SRC_KMAP_ATOMIC_ARGS ZFS_AC_KERNEL_SRC_KMAP_LOCAL_PAGE ZFS_AC_KERNEL_SRC_FOLLOW_DOWN_ONE @@ -247,7 +246,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [ ZFS_AC_KERNEL_VFS_REMAP_FILE_RANGE ZFS_AC_KERNEL_VFS_CLONE_FILE_RANGE ZFS_AC_KERNEL_VFS_DEDUPE_FILE_RANGE - ZFS_AC_KERNEL_VFS_FILE_OPERATIONS_EXTEND ZFS_AC_KERNEL_KMAP_ATOMIC_ARGS ZFS_AC_KERNEL_KMAP_LOCAL_PAGE ZFS_AC_KERNEL_FOLLOW_DOWN_ONE diff --git a/include/os/linux/zfs/sys/zpl.h b/include/os/linux/zfs/sys/zpl.h index 699b69943..9f68b3042 100644 --- a/include/os/linux/zfs/sys/zpl.h +++ b/include/os/linux/zfs/sys/zpl.h @@ -51,11 +51,7 @@ extern const struct inode_operations zpl_special_inode_operations; /* zpl_file.c */ extern const struct address_space_operations zpl_address_space_operations; -#ifdef HAVE_VFS_FILE_OPERATIONS_EXTEND -extern const struct file_operations_extend zpl_file_operations; -#else extern const struct file_operations zpl_file_operations; -#endif extern const struct file_operations zpl_dir_file_operations; /* zpl_super.c */ diff --git a/module/os/linux/zfs/zfs_vfsops.c b/module/os/linux/zfs/zfs_vfsops.c index 44275e7b9..9d695a50c 100644 --- a/module/os/linux/zfs/zfs_vfsops.c +++ b/module/os/linux/zfs/zfs_vfsops.c @@ -2027,9 +2027,6 @@ zfs_init(void) zfs_znode_init(); dmu_objset_register_type(DMU_OST_ZFS, zpl_get_file_info); register_filesystem(&zpl_fs_type); -#ifdef HAVE_VFS_FILE_OPERATIONS_EXTEND - register_fo_extend(&zpl_file_operations); -#endif } void @@ -2040,9 +2037,6 @@ zfs_fini(void) */ taskq_wait(system_delay_taskq); taskq_wait(system_taskq); -#ifdef HAVE_VFS_FILE_OPERATIONS_EXTEND - unregister_fo_extend(&zpl_file_operations); -#endif unregister_filesystem(&zpl_fs_type); zfs_znode_fini(); zfsctl_fini(); diff --git a/module/os/linux/zfs/zfs_znode.c b/module/os/linux/zfs/zfs_znode.c index 24aee0b88..bc01faed1 100644 --- a/module/os/linux/zfs/zfs_znode.c +++ b/module/os/linux/zfs/zfs_znode.c @@ -415,11 +415,7 @@ zfs_inode_set_ops(zfsvfs_t *zfsvfs, struct inode *ip) switch (ip->i_mode & S_IFMT) { case S_IFREG: ip->i_op = &zpl_inode_operations; -#ifdef HAVE_VFS_FILE_OPERATIONS_EXTEND - ip->i_fop = &zpl_file_operations.kabi_fops; -#else ip->i_fop = &zpl_file_operations; -#endif ip->i_mapping->a_ops = &zpl_address_space_operations; break; @@ -459,11 +455,7 @@ zfs_inode_set_ops(zfsvfs_t *zfsvfs, struct inode *ip) /* Assume the inode is a file and attempt to continue */ ip->i_mode = S_IFREG | 0644; ip->i_op = &zpl_inode_operations; -#ifdef HAVE_VFS_FILE_OPERATIONS_EXTEND - ip->i_fop = &zpl_file_operations.kabi_fops; -#else ip->i_fop = &zpl_file_operations; -#endif ip->i_mapping->a_ops = &zpl_address_space_operations; break; } diff --git a/module/os/linux/zfs/zpl_file.c b/module/os/linux/zfs/zpl_file.c index 97259ba5f..aaccdef55 100644 --- a/module/os/linux/zfs/zpl_file.c +++ b/module/os/linux/zfs/zpl_file.c @@ -1126,12 +1126,7 @@ const struct address_space_operations zpl_address_space_operations = { #endif }; -#ifdef HAVE_VFS_FILE_OPERATIONS_EXTEND -const struct file_operations_extend zpl_file_operations = { - .kabi_fops = { -#else const struct file_operations zpl_file_operations = { -#endif .open = zpl_open, .release = zpl_release, .llseek = zpl_llseek, @@ -1170,11 +1165,6 @@ const struct file_operations zpl_file_operations = { #ifdef CONFIG_COMPAT .compat_ioctl = zpl_compat_ioctl, #endif -#ifdef HAVE_VFS_FILE_OPERATIONS_EXTEND - }, /* kabi_fops */ - .copy_file_range = zpl_copy_file_range, - .clone_file_range = zpl_clone_file_range, -#endif }; const struct file_operations zpl_dir_file_operations = { diff --git a/module/os/linux/zfs/zpl_file_range.c b/module/os/linux/zfs/zpl_file_range.c index 64728fdb1..58f3c200a 100644 --- a/module/os/linux/zfs/zpl_file_range.c +++ b/module/os/linux/zfs/zpl_file_range.c @@ -83,8 +83,7 @@ zpl_clone_file_range_impl(struct file *src_file, loff_t src_off, return ((ssize_t)len_o); } -#if defined(HAVE_VFS_COPY_FILE_RANGE) || \ - defined(HAVE_VFS_FILE_OPERATIONS_EXTEND) +#if defined(HAVE_VFS_COPY_FILE_RANGE) /* * Entry point for copy_file_range(). Copy len bytes from src_off in src_file * to dst_off in dst_file. We are permitted to do this however we like, so we @@ -134,7 +133,7 @@ zpl_copy_file_range(struct file *src_file, loff_t src_off, return (ret); } -#endif /* HAVE_VFS_COPY_FILE_RANGE || HAVE_VFS_FILE_OPERATIONS_EXTEND */ +#endif /* HAVE_VFS_COPY_FILE_RANGE */ #ifdef HAVE_VFS_REMAP_FILE_RANGE /* @@ -179,8 +178,7 @@ zpl_remap_file_range(struct file *src_file, loff_t src_off, } #endif /* HAVE_VFS_REMAP_FILE_RANGE */ -#if defined(HAVE_VFS_CLONE_FILE_RANGE) || \ - defined(HAVE_VFS_FILE_OPERATIONS_EXTEND) +#if defined(HAVE_VFS_CLONE_FILE_RANGE) /* * Entry point for FICLONE and FICLONERANGE, before Linux 4.20. */ @@ -201,7 +199,7 @@ zpl_clone_file_range(struct file *src_file, loff_t src_off, return (ret); } -#endif /* HAVE_VFS_CLONE_FILE_RANGE || HAVE_VFS_FILE_OPERATIONS_EXTEND */ +#endif /* HAVE_VFS_CLONE_FILE_RANGE */ #ifdef HAVE_VFS_DEDUPE_FILE_RANGE /* |