[PATCH 5/6] fuse2fs: increase inode cache size

Darrick J. Wong
2025-09-16T01:08:08Z

Increase the internal inode cache size. Does this improve performance
any?

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

diff --git a/fuse4fs/fuse4fs.c b/fuse4fs/fuse4fs.c
index 2dd7c0f6759de5..3e8822fac08630 100644
--- a/fuse4fs/fuse4fs.c
+++ b/fuse4fs/fuse4fs.c
@@ -1311,6 +1311,10 @@ static errcode_t fuse4fs_open(struct fuse4fs *ff, int libext2_flags)
if (err)
return translate_error(ff->fs, 0, err);

+ err = ext2fs_create_inode_cache(ff->fs, 1024);
+ if (err)
+ return translate_error(ff->fs, 0, err);
+
ff->fs->priv_data = ff;
ff->blocklog = u_log2(ff->fs->blocksize);
ff->blockmask = ff->fs->blocksize - 1;
diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index 8bd7cedc9f1ca8..83a3ed3ac3450e 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -1139,6 +1139,10 @@ static errcode_t fuse2fs_open(struct fuse2fs *ff, int libext2_flags)
return err;
}

+ err = ext2fs_create_inode_cache(ff->fs, 1024);
+ if (err)
+ return translate_error(ff->fs, 0, err);
+
ff->fs->priv_data = ff;
ff->blocklog = u_log2(ff->fs->blocksize);
ff->blockmask = ff->fs->blocksize - 1;