From fda7068da735d3e574bc46b70d3af62a5db8e908 Mon Sep 17 00:00:00 2001 From: Huang Xiaojia Date: Mon, 11 Nov 2024 17:08:14 +0800 Subject: fsck.ubifs: Check and create the lost+found This is the 16/18 step of fsck. Check whether the lost+found is existed, create a new one if it is not found. This step makes sure that disconnected file can be recovered under the lost+found. Signed-off-by: Huang Xiaojia Signed-off-by: Zhihao Cheng Signed-off-by: David Oberhollenzer --- ubifs-utils/fsck.ubifs/fsck.ubifs.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ubifs-utils/fsck.ubifs/fsck.ubifs.h') diff --git a/ubifs-utils/fsck.ubifs/fsck.ubifs.h b/ubifs-utils/fsck.ubifs/fsck.ubifs.h index fb7ccca..0e2a081 100644 --- a/ubifs-utils/fsck.ubifs/fsck.ubifs.h +++ b/ubifs-utils/fsck.ubifs/fsck.ubifs.h @@ -277,6 +277,7 @@ struct ubifs_rebuild_info { * @lpts: lprops table * @try_rebuild: %true means that try to rebuild fs when fsck failed * @rebuild: rebuilding-related information + * @lost_and_found: inode number of the lost+found directory, %0 means invalid */ struct ubifs_fsck_info { int mode; @@ -288,6 +289,7 @@ struct ubifs_fsck_info { struct ubifs_lprops *lpts; bool try_rebuild; struct ubifs_rebuild_info *rebuild; + ino_t lost_and_found; }; #define FSCK(c) ((struct ubifs_fsck_info*)c->private) @@ -383,4 +385,7 @@ int build_lpt(struct ubifs_info *c, calculate_lp_callback calculate_lp_cb, int check_and_correct_space(struct ubifs_info *c); int check_and_correct_index_size(struct ubifs_info *c); +/* handle_disconnected.c */ +int check_and_create_lost_found(struct ubifs_info *c); + #endif -- cgit v1.2.3