[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <175797570049.246189.1110386236122504548.stgit@frogsfrogsfrogs>
Date: Mon, 15 Sep 2025 15:41:22 -0700
From: "Darrick J. Wong" <djwong@...nel.org>
To: tytso@....edu
Cc: linux-ext4@...r.kernel.org
Subject: [PATCH 02/11] fuse2fs: read bitmaps asynchronously during
initialization
From: Darrick J. Wong <djwong@...nel.org>
The kernel reads the bitmaps asynchronously when the filesystem is
mounted. Do this as well in fuse2fs to reduce mount times.
Signed-off-by: "Darrick J. Wong" <djwong@...nel.org>
---
misc/fuse2fs.c | 29 +++++++++++++++++++----------
1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index 8389cc3a4872b2..438ac1194082b8 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -901,6 +901,21 @@ static int fuse2fs_setup_logging(struct fuse2fs *ff)
return 0;
}
+static int fuse2fs_read_bitmaps(struct fuse2fs *ff)
+{
+ errcode_t err;
+
+ err = ext2fs_read_inode_bitmap(ff->fs);
+ if (err)
+ return translate_error(ff->fs, 0, err);
+
+ err = ext2fs_read_block_bitmap(ff->fs);
+ if (err)
+ return translate_error(ff->fs, 0, err);
+
+ return 0;
+}
+
static void *op_init(struct fuse_conn_info *conn
#if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0)
, struct fuse_config *cfg EXT2FS_ATTR((unused))
@@ -948,6 +963,10 @@ static void *op_init(struct fuse_conn_info *conn
uuid_unparse(fs->super->s_uuid, uuid);
log_printf(ff, "%s %s.\n", _("mounted filesystem"), uuid);
}
+
+ if (global_fs->flags & EXT2_FLAG_RW)
+ fuse2fs_read_bitmaps(ff);
+
return ff;
}
@@ -4844,16 +4863,6 @@ int main(int argc, char *argv[])
_("Warning: fuse2fs does not support using the journal.\n"
"There may be file system corruption or data loss if\n"
"the file system is not gracefully unmounted.\n"));
- err = ext2fs_read_inode_bitmap(global_fs);
- if (err) {
- translate_error(global_fs, 0, err);
- goto out;
- }
- err = ext2fs_read_block_bitmap(global_fs);
- if (err) {
- translate_error(global_fs, 0, err);
- goto out;
- }
}
if (!(global_fs->super->s_state & EXT2_VALID_FS))
Powered by blists - more mailing lists