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-05-31 12:04:31 -0700
commitc2c2e7bb8b7c269904777b61f4b0a678f1ffb9a3 (patch)
tree345363037a2ffebcdb4cc0d4b2aeda9f2cbd7199 /module
parenta12a5cb5b821f24f26d388094cdac79deb0e879f (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 8b84eb795..9a640fb40 100644
--- a/module/os/linux/zfs/zpl_file.c
+++ b/module/os/linux/zfs/zpl_file.c
@@ -674,11 +674,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)
@@ -1208,7 +1216,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,