[PATCH 05/16] fuse2fs: use tagged block IO for zeroing sub-block regions

Darrick J. Wong
2025-05-22T00:12:09Z

Change the punch hole helpers to use the tagged block IO commands now
that libext2fs uses tagged block IO commands for file IO. We'll need
this in the next patch when we turn on selective IO manager cache
clearing and invalidation.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
misc/fuse2fs.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index b1f3002ec8c481..c0f868e8f01ed4 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -4510,13 +4510,13 @@ static errcode_t clean_block_middle(struct fuse2fs *ff, ext2_ino_t ino,
if (!blk || (retflags & BMAP_RET_UNINIT))
return 0;

- err = io_channel_read_blk(fs->io, blk, 1, *buf);
+ err = io_channel_read_tagblk(fs->io, ino, blk, 1, *buf);
if (err)
return err;

memset(*buf + residue, 0, len);

- return io_channel_write_blk(fs->io, blk, 1, *buf);
+ return io_channel_write_tagblk(fs->io, ino, blk, 1, *buf);
}

static errcode_t clean_block_edge(struct fuse2fs *ff, ext2_ino_t ino,
@@ -4544,7 +4544,7 @@ static errcode_t clean_block_edge(struct fuse2fs *ff, ext2_ino_t ino,
if (err)
return err;

- err = io_channel_read_blk(fs->io, blk, 1, *buf);
+ err = io_channel_read_tagblk(fs->io, ino, blk, 1, *buf);
if (err)
return err;
if (!blk || (retflags & BMAP_RET_UNINIT))
@@ -4555,7 +4555,7 @@ static errcode_t clean_block_edge(struct fuse2fs *ff, ext2_ino_t ino,
else
memset(*buf + residue, 0, fs->blocksize - residue);

- return io_channel_write_blk(fs->io, blk, 1, *buf);
+ return io_channel_write_tagblk(fs->io, ino, blk, 1, *buf);
}

static int punch_helper(struct fuse_file_info *fp, int mode, off_t offset,