+++ /dev/null
-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)
- ])
-])
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
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
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
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
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
#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)
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;
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;
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);
}