]> git.proxmox.com Git - mirror_zfs.git/commitdiff
config: remove HAVE_FILEMAP_RANGE_HAS_PAGE
authorRob Norris <robn@despairlabs.com>
Sat, 24 Aug 2024 10:36:14 +0000 (20:36 +1000)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 18 Sep 2024 18:23:50 +0000 (11:23 -0700)
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

config/kernel-filemap.m4 [deleted file]
config/kernel.m4
include/os/linux/zfs/sys/zfs_znode_impl.h
module/os/linux/zfs/zfs_ctldir.c
module/os/linux/zfs/zfs_znode.c
module/os/linux/zfs/zpl_file.c

diff --git a/config/kernel-filemap.m4 b/config/kernel-filemap.m4
deleted file mode 100644 (file)
index 0b7da82..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-dnl #
-dnl # filemap_range_has_page was not available till 4.13
-dnl #
-AC_DEFUN([ZFS_AC_KERNEL_SRC_FILEMAP], [
-       ZFS_LINUX_TEST_SRC([filemap_range_has_page], [
-               #include <linux/fs.h>
-               #include <linux/pagemap.h>
-       ],[
-               struct address_space *mapping = NULL;
-               loff_t lstart = 0;
-               loff_t lend = 0;
-               bool ret __attribute__ ((unused));
-
-               ret = filemap_range_has_page(mapping, lstart, lend);
-       ])
-])
-
-AC_DEFUN([ZFS_AC_KERNEL_FILEMAP], [
-       AC_MSG_CHECKING([whether filemap_range_has_page() is available])
-       ZFS_LINUX_TEST_RESULT([filemap_range_has_page], [
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_FILEMAP_RANGE_HAS_PAGE, 1,
-               [filemap_range_has_page() is available])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
index ef8eb8d4381c760c2b0134cd85f8a74086197e5e..80481141a9c4d9f3ff8616609d4cc1de97c5f97c 100644 (file)
@@ -69,7 +69,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
        ZFS_AC_KERNEL_SRC_INODE_GETATTR
        ZFS_AC_KERNEL_SRC_INODE_SET_IVERSION
        ZFS_AC_KERNEL_SRC_SHOW_OPTIONS
-       ZFS_AC_KERNEL_SRC_FILEMAP
        ZFS_AC_KERNEL_SRC_SHRINKER
        ZFS_AC_KERNEL_SRC_MKDIR
        ZFS_AC_KERNEL_SRC_LOOKUP_FLAGS
@@ -132,7 +131,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
        ZFS_AC_KERNEL_SRC_IDMAP_MNT_API
        ZFS_AC_KERNEL_SRC_IDMAP_NO_USERNS
        ZFS_AC_KERNEL_SRC_IATTR_VFSID
-       ZFS_AC_KERNEL_SRC_FILEMAP
        ZFS_AC_KERNEL_SRC_WRITEPAGE_T
        ZFS_AC_KERNEL_SRC_RECLAIMED
        ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_TABLE
@@ -193,7 +191,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
        ZFS_AC_KERNEL_INODE_GETATTR
        ZFS_AC_KERNEL_INODE_SET_IVERSION
        ZFS_AC_KERNEL_SHOW_OPTIONS
-       ZFS_AC_KERNEL_FILEMAP
        ZFS_AC_KERNEL_SHRINKER
        ZFS_AC_KERNEL_MKDIR
        ZFS_AC_KERNEL_LOOKUP_FLAGS
@@ -256,7 +253,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
        ZFS_AC_KERNEL_IDMAP_MNT_API
        ZFS_AC_KERNEL_IDMAP_NO_USERNS
        ZFS_AC_KERNEL_IATTR_VFSID
-       ZFS_AC_KERNEL_FILEMAP
        ZFS_AC_KERNEL_WRITEPAGE_T
        ZFS_AC_KERNEL_RECLAIMED
        ZFS_AC_KERNEL_REGISTER_SYSCTL_TABLE
index e028865189cf201cea625e1f62fd48e827ae2553..cbc85230188194d596bfc872fe54e8a250ce6012 100644 (file)
 extern "C" {
 #endif
 
-#if defined(HAVE_FILEMAP_RANGE_HAS_PAGE)
 #define        ZNODE_OS_FIELDS                 \
        inode_timespec_t z_btime; /* creation/birth time (cached) */ \
        struct inode    z_inode;
-#else
-#define        ZNODE_OS_FIELDS                 \
-       inode_timespec_t z_btime; /* creation/birth time (cached) */ \
-       struct inode    z_inode;                                     \
-       boolean_t       z_is_mapped;    /* we are mmap'ed */
-#endif
 
 /*
  * Convert between znode pointers and inode pointers
@@ -77,13 +70,8 @@ extern "C" {
 #define        Z_ISDEV(type)   (S_ISCHR(type) || S_ISBLK(type) || S_ISFIFO(type))
 #define        Z_ISDIR(type)   S_ISDIR(type)
 
-#if defined(HAVE_FILEMAP_RANGE_HAS_PAGE)
 #define        zn_has_cached_data(zp, start, end) \
        filemap_range_has_page(ZTOI(zp)->i_mapping, start, end)
-#else
-#define        zn_has_cached_data(zp, start, end) \
-       ((zp)->z_is_mapped)
-#endif
 
 #define        zn_flush_cached_data(zp, sync)  write_inode_now(ZTOI(zp), sync)
 #define        zn_rlimit_fsize(size)           (0)
index e042116333fb05f7767d6d91a8b742dfadddfeb1..a8b25b2bd8a5117c450d6af88872599a88bb92e4 100644 (file)
@@ -500,9 +500,6 @@ zfsctl_inode_alloc(zfsvfs_t *zfsvfs, uint64_t id,
        zp->z_atime_dirty = B_FALSE;
        zp->z_zn_prefetch = B_FALSE;
        zp->z_is_sa = B_FALSE;
-#if !defined(HAVE_FILEMAP_RANGE_HAS_PAGE)
-       zp->z_is_mapped = B_FALSE;
-#endif
        zp->z_is_ctldir = B_TRUE;
        zp->z_sa_hdl = NULL;
        zp->z_blksz = 0;
index 7f031d16fb47a3e10633e8fbb99859218ab7afdb..8b0011c37c53b088e816131823c7a6a556e38650 100644 (file)
@@ -535,9 +535,6 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz,
        ASSERT3P(zp->z_xattr_cached, ==, NULL);
        zp->z_unlinked = B_FALSE;
        zp->z_atime_dirty = B_FALSE;
-#if !defined(HAVE_FILEMAP_RANGE_HAS_PAGE)
-       zp->z_is_mapped = B_FALSE;
-#endif
        zp->z_is_ctldir = B_FALSE;
        zp->z_suspended = B_FALSE;
        zp->z_sa_hdl = NULL;
index 25aa43416b1436b84d857f2eb72d569bff5c16ff..4d1bf1d5477fcb4f0f777cb0bfccc0e83194aae1 100644 (file)
@@ -432,13 +432,6 @@ zpl_mmap(struct file *filp, struct vm_area_struct *vma)
        if (error)
                return (error);
 
-#if !defined(HAVE_FILEMAP_RANGE_HAS_PAGE)
-       znode_t *zp = ITOZ(ip);
-       mutex_enter(&zp->z_lock);
-       zp->z_is_mapped = B_TRUE;
-       mutex_exit(&zp->z_lock);
-#endif
-
        return (error);
 }