summaryrefslogtreecommitdiffstats
path: root/config/kernel-vfs-read_folio.m4
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2022-05-27 20:44:43 +0000
committerBrian Behlendorf <[email protected]>2022-06-01 14:24:49 -0700
commitfec407fb69b77b567775e214a08c74e4ba9a3d42 (patch)
tree1f475857b51f2bdebd222260ebddf5daf0680c20 /config/kernel-vfs-read_folio.m4
parent7ae5ea8864d7a0cbf63feb61bd9022adc803b60d (diff)
Linux 5.19 compat: aops->read_folio()
As of the Linux 5.19 kernel the readpage() address space operation has been replaced by read_folio(). Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #13515
Diffstat (limited to 'config/kernel-vfs-read_folio.m4')
-rw-r--r--config/kernel-vfs-read_folio.m432
1 files changed, 32 insertions, 0 deletions
diff --git a/config/kernel-vfs-read_folio.m4 b/config/kernel-vfs-read_folio.m4
new file mode 100644
index 000000000..234d1212a
--- /dev/null
+++ b/config/kernel-vfs-read_folio.m4
@@ -0,0 +1,32 @@
+dnl #
+dnl # Linux 5.19 uses read_folio in lieu of readpage
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_READ_FOLIO], [
+ ZFS_LINUX_TEST_SRC([vfs_has_read_folio], [
+ #include <linux/fs.h>
+
+ static int
+ test_read_folio(struct file *file, struct folio *folio) {
+ (void) file; (void) folio;
+ return (0);
+ }
+
+ static const struct address_space_operations
+ aops __attribute__ ((unused)) = {
+ .read_folio = test_read_folio,
+ };
+ ],[])
+])
+
+AC_DEFUN([ZFS_AC_KERNEL_VFS_READ_FOLIO], [
+ dnl #
+ dnl # Linux 5.19 uses read_folio in lieu of readpage
+ dnl #
+ AC_MSG_CHECKING([read_folio exists])
+ ZFS_LINUX_TEST_RESULT([vfs_has_read_folio], [
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_VFS_READ_FOLIO, 1, [read_folio exists])
+ ],[
+ AC_MSG_RESULT([no])
+ ])
+])