aboutsummaryrefslogtreecommitdiffstats
path: root/module
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 /module
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 'module')
-rw-r--r--module/os/linux/zfs/zpl_file.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/module/os/linux/zfs/zpl_file.c b/module/os/linux/zfs/zpl_file.c
index 626e7f79d..38d2bd147 100644
--- a/module/os/linux/zfs/zpl_file.c
+++ b/module/os/linux/zfs/zpl_file.c
@@ -635,11 +635,19 @@ zpl_readpage_common(struct page *pp)
return (error);
}
+#ifdef HAVE_VFS_READ_FOLIO
+static int
+zpl_read_folio(struct file *filp, struct folio *folio)
+{
+ return (zpl_readpage_common(&folio->page));
+}
+#else
static int
zpl_readpage(struct file *filp, struct page *pp)
{
return (zpl_readpage_common(pp));
}
+#endif
static int
zpl_readpage_filler(void *data, struct page *pp)
@@ -1057,7 +1065,11 @@ const struct address_space_operations zpl_address_space_operations = {
#else
.readahead = zpl_readahead,
#endif
+#ifdef HAVE_VFS_READ_FOLIO
+ .read_folio = zpl_read_folio,
+#else
.readpage = zpl_readpage,
+#endif
.writepage = zpl_writepage,
.writepages = zpl_writepages,
.direct_IO = zpl_direct_IO,