[PATCH RFC 2/4] erofs: expose erofs_iomap_{begin, end}
Hongzhen Luo
hongzhen at linux.alibaba.com
Mon Jul 22 16:53:52 AEST 2024
Expose erofs_iomap_{begin, end} to prepare for the implementation
of the page cache share feature.
Signed-off-by: Hongzhen Luo <hongzhen at linux.alibaba.com>
---
fs/erofs/data.c | 4 ++--
fs/erofs/internal.h | 5 +++++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/fs/erofs/data.c b/fs/erofs/data.c
index 8be60797ea2f..0d0997c53ff9 100644
--- a/fs/erofs/data.c
+++ b/fs/erofs/data.c
@@ -249,7 +249,7 @@ int erofs_map_dev(struct super_block *sb, struct erofs_map_dev *map)
return 0;
}
-static int erofs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
+int erofs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
unsigned int flags, struct iomap *iomap, struct iomap *srcmap)
{
int ret;
@@ -308,7 +308,7 @@ static int erofs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
return 0;
}
-static int erofs_iomap_end(struct inode *inode, loff_t pos, loff_t length,
+int erofs_iomap_end(struct inode *inode, loff_t pos, loff_t length,
ssize_t written, unsigned int flags, struct iomap *iomap)
{
void *ptr = iomap->private;
diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
index 3f1984664dac..2c695ec6ee71 100644
--- a/fs/erofs/internal.h
+++ b/fs/erofs/internal.h
@@ -389,6 +389,11 @@ extern const struct iomap_ops z_erofs_iomap_report_ops;
extern struct file_system_type erofs_anon_fs_type;
+extern int erofs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
+ unsigned int flags, struct iomap *iomap, struct iomap *srcmap);
+extern int erofs_iomap_end(struct inode *inode, loff_t pos, loff_t length,
+ ssize_t written, unsigned int flags, struct iomap *iomap);
+
/* flags for erofs_fscache_register_cookie() */
#define EROFS_REG_COOKIE_SHARE 0x0001
#define EROFS_REG_COOKIE_NEED_NOEXIST 0x0002
--
2.43.5
More information about the Linux-erofs
mailing list