summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-01-29 20:56:31 +0100
committerCarl Hetherington <cth@carlh.net>2023-01-29 20:56:31 +0100
commit3dc752da8948564456ce2d721c266b4e1a50e7a1 (patch)
treecf9d914df094c171ef0db5001fb8b28b17a30a90 /src
parentee865fa65f05e348cd4e0bce0552a2725ad5663a (diff)
Add a little more logging to mkfs.
Diffstat (limited to 'src')
-rw-r--r--src/ext4_mkfs.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/ext4_mkfs.c b/src/ext4_mkfs.c
index 4765926..60346ef 100644
--- a/src/ext4_mkfs.c
+++ b/src/ext4_mkfs.c
@@ -480,10 +480,12 @@ static int mkfs_init(struct ext4_fs *fs, struct ext4_blockdev *bd, struct ext4_m
fill_sb(&aux_info, info);
memcpy(&fs->sb, aux_info.sb, sizeof(struct ext4_sblock));
+ ext4_dbg(DEBUG_MKFS, DBG_NONE "mkfs_init: write_bgroups");
r = write_bgroups(fs, bd, &aux_info, info, progress, progress_context);
if (r != EOK)
goto Finish;
+ ext4_dbg(DEBUG_MKFS, DBG_NONE "mkfs_init: write_sblocks");
r = write_sblocks(bd, &aux_info, info);
if (r != EOK)
goto Finish;
@@ -665,6 +667,10 @@ int ext4_mkfs(struct ext4_fs *fs, struct ext4_blockdev *bd,
{
int r;
+ ext4_dbg(DEBUG_MKFS, DBG_NONE "ext4_mkfs start");
+
+ ext4_dbg(DEBUG_MKFS, DBG_NONE "ext4_block_init");
+
r = ext4_block_init(bd);
if (r != EOK)
return r;
@@ -771,16 +777,22 @@ int ext4_mkfs(struct ext4_fs *fs, struct ext4_blockdev *bd,
memset(&bc, 0, sizeof(struct ext4_bcache));
ext4_block_set_lb_size(bd, info->block_size);
+ ext4_dbg(DEBUG_MKFS, DBG_NONE "ext4_bcache_init_dynamic");
+
r = ext4_bcache_init_dynamic(&bc, CONFIG_BLOCK_DEV_CACHE_SIZE,
info->block_size);
if (r != EOK)
goto block_fini;
+ ext4_dbg(DEBUG_MKFS, DBG_NONE "ext4_block_bind_bcache");
+
/*Bind block cache to block device*/
r = ext4_block_bind_bcache(bd, &bc);
if (r != EOK)
goto cache_fini;
+ ext4_dbg(DEBUG_MKFS, DBG_NONE "ext4_block_cache_write_back");
+
r = ext4_block_cache_write_back(bd, 1);
if (r != EOK)
goto cache_fini;
@@ -788,34 +800,49 @@ int ext4_mkfs(struct ext4_fs *fs, struct ext4_blockdev *bd,
fs->bdev = bd;
fs->read_only = false;
+ ext4_dbg(DEBUG_MKFS, DBG_NONE "mkfs_init");
+
r = mkfs_init(fs, bd, info, progress, progress_context);
if (r != EOK)
goto cache_fini;
+ ext4_dbg(DEBUG_MKFS, DBG_NONE "ext4_fs_init");
+
r = ext4_fs_init(fs, bd, false);
if (r != EOK)
goto cache_fini;
+ ext4_dbg(DEBUG_MKFS, DBG_NONE "alloc_inodes");
+
r = alloc_inodes(fs);
if (r != EOK)
goto fs_fini;
+ ext4_dbg(DEBUG_MKFS, DBG_NONE "create_dirs");
+
r = create_dirs(fs);
if (r != EOK)
goto fs_fini;
+ ext4_dbg(DEBUG_MKFS, DBG_NONE "create_journal_inode");
+
r = create_journal_inode(fs, info);
if (r != EOK)
goto fs_fini;
fs_fini:
+ ext4_dbg(DEBUG_MKFS, DBG_NONE "ext4_fs_fini");
ext4_fs_fini(fs);
cache_fini:
+ ext4_dbg(DEBUG_MKFS, DBG_NONE "ext4_block_cache_write_back");
ext4_block_cache_write_back(bd, 0);
+
+ ext4_dbg(DEBUG_MKFS, DBG_NONE "ext4_bcache_fini_dynamic");
ext4_bcache_fini_dynamic(&bc);
block_fini:
+ ext4_dbg(DEBUG_MKFS, DBG_NONE "ext4_block_fini");
ext4_block_fini(bd);
return r;