mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 01:51:00 +03:00
config: remove HAVE_FILEMAP_RANGE_HAS_PAGE
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
54af0088fb
commit
a817992559
@ -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)
|
||||
])
|
||||
])
|
@ -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
|
||||
|
@ -47,16 +47,9 @@
|
||||
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)
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user