aboutsummaryrefslogtreecommitdiff
path: root/ubifs-utils/fsck.ubifs/fsck.ubifs.c
diff options
context:
space:
mode:
authorZhihao Cheng <chengzhihao1@huawei.com>2024-11-11 17:01:05 +0800
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2024-11-11 10:32:45 +0100
commitfabde6440cac726bcd6cec36bbc9946b67be45da (patch)
tree14650b80e7bb5bb8e14e3d23c2ed886d9b15687c /ubifs-utils/fsck.ubifs/fsck.ubifs.c
parent518e5374471233125a595c5aeff2d0c3f5d27c0b (diff)
fsck.ubifs: Load filesystem information from UBI volume
Load filesystem information from UBI volume (Similar to UBIFS mounting process), initialize kinds of buffers and read superblock. This is the base step for both fsck and rebuild_fs. Subsequent pacthes will complete this step by adding more steps(eg. read master, replay journal, etc.) which are only used in fsck. Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'ubifs-utils/fsck.ubifs/fsck.ubifs.c')
-rw-r--r--ubifs-utils/fsck.ubifs/fsck.ubifs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ubifs-utils/fsck.ubifs/fsck.ubifs.c b/ubifs-utils/fsck.ubifs/fsck.ubifs.c
index a367241..ef94fcf 100644
--- a/ubifs-utils/fsck.ubifs/fsck.ubifs.c
+++ b/ubifs-utils/fsck.ubifs/fsck.ubifs.c
@@ -423,8 +423,15 @@ int main(int argc, char *argv[])
goto out_destroy_fsck;
}
+ /* Init: Read superblock */
+ err = ubifs_load_filesystem(c);
+ if (err)
+ goto out_close;
+
err = do_fsck();
+ ubifs_destroy_filesystem(c);
+out_close:
ubifs_close_volume(c);
out_destroy_fsck:
destroy_fsck_info(c);