[PATCH 2/4] fuse2fs: constrain iomap mapping cache size

Darrick J. Wong
2026-04-29T15:01:45Z

Update the iomap config functions to handle the new iomap mapping cache
size restriction knob.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
fuse4fs/fuse4fs.c | 6 ++++--
misc/fuse2fs.c | 5 +++--
2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/fuse4fs/fuse4fs.c b/fuse4fs/fuse4fs.c
index 56a79dd48c9f43..d07c576d31862a 100644
--- a/fuse4fs/fuse4fs.c
+++ b/fuse4fs/fuse4fs.c
@@ -7481,9 +7481,11 @@ static void op_iomap_config(fuse_req_t req,

FUSE4FS_CHECK_CONTEXT(req);

- dbg_printf(ff, "%s: flags=0x%llx maxbytes=0x%llx\n", __func__,
+ dbg_printf(ff, "%s: flags=0x%llx maxbytes=0x%llx cache_maxbytes=0x%x\n",
+ __func__,
(unsigned long long)p->flags,
- (unsigned long long)p->maxbytes);
+ (unsigned long long)p->maxbytes,
+ p->cache_maxbytes);
fs = fuse4fs_start(ff);

cfg.flags |= FUSE_IOMAP_CONFIG_UUID;
diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index e485c38bda41e8..232181bc170183 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -6753,9 +6753,10 @@ static int op_iomap_config(const struct fuse_iomap_config_params *p,

FUSE2FS_CHECK_CONTEXT(ff);

- dbg_printf(ff, "%s: flags=0x%llx maxbytes=0x%llx\n", __func__,
+ dbg_printf(ff, "%s: flags=0x%llx maxbytes=0x%llx cache_maxbytes=%u\n", __func__,
(unsigned long long)p->flags,
- (unsigned long long)p->maxbytes);
+ (unsigned long long)p->maxbytes,
+ p->cache_maxbytes);
fs = fuse2fs_start(ff);

cfg->flags |= FUSE_IOMAP_CONFIG_UUID;