[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <174787198686.1484996.7993409438926165203.stgit@frogsfrogsfrogs>
Date: Wed, 21 May 2025 17:14:30 -0700
From: "Darrick J. Wong" <djwong@...nel.org>
To: tytso@....edu
Cc: John@...ves.net, linux-ext4@...r.kernel.org, miklos@...redi.hu,
joannelkoong@...il.com, bernd@...ernd.com, linux-fsdevel@...r.kernel.org
Subject: [PATCH 14/16] fuse2fs: disable most io channel flush/invalidate in
iomap pagecache mode
From: Darrick J. Wong <djwong@...nel.org>
Now that fuse2fs uses iomap for pagecache IO, all regular file IO goes
directly to the disk. There is no need to flush the unix IO manager's
disk cache (or invalidate it) because it does not contain file data.
Signed-off-by: "Darrick J. Wong" <djwong@...nel.org>
---
misc/fuse2fs.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index 842ea3a191fa44..ba8c5f301625c6 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -5091,9 +5091,11 @@ static int fuse_iomap_begin_read(struct fuse2fs *ff, ext2_ino_t ino,
return -ENOSYS;
/* flush dirty io_channel buffers to disk before iomap reads them */
- err = io_channel_flush_tag(ff->fs->io, ino);
- if (err)
- return translate_error(ff->fs, ino, err);
+ if (!iomap_does_fileio(ff)) {
+ err = io_channel_flush_tag(ff->fs->io, ino);
+ if (err)
+ return translate_error(ff->fs, ino, err);
+ }
if (inode->i_flags & EXT4_EXTENTS_FL)
return extent_iomap_begin(ff, ino, inode, pos, count, opflags,
@@ -5188,9 +5190,11 @@ static int fuse_iomap_begin_write(struct fuse2fs *ff, ext2_ino_t ino,
* flush and invalidate the file's io_channel buffers before iomap
* writes them
*/
- err = io_channel_invalidate_tag(ff->fs->io, ino);
- if (err)
- return translate_error(ff->fs, ino, err);
+ if (!iomap_does_fileio(ff)) {
+ err = io_channel_invalidate_tag(ff->fs->io, ino);
+ if (err)
+ return translate_error(ff->fs, ino, err);
+ }
return 0;
}
@@ -5685,7 +5689,7 @@ static int op_iomap_ioend(const char *path, uint64_t nodeid, uint64_t attr_ino,
* flush and invalidate the file's io_channel buffers again now that
* iomap wrote them
*/
- if (written > 0) {
+ if (written > 0 && !iomap_does_fileio(ff)) {
err = io_channel_invalidate_tag(ff->fs->io, attr_ino);
if (err) {
ret = translate_error(ff->fs, attr_ino, err);
Powered by blists - more mailing lists