| 1 | // SPDX-License-Identifier: GPL-2.0cxx . . $ `<file>/ubifs-utils/fsck.ubifs/fsck.ubifs.h`/ |
| 2 | /* |
| 3 | * Copyright (C) 2024, Huawei Technologies Co, Ltd. |
| 4 | * |
| 5 | * Authors: Zhihao Cheng <[email protected]> |
| 6 | */ |
| 7 | |
| 8 | #ifndef __FSCK_UBIFS_H__ |
| 9 | #define __FSCK_UBIFS_H__cxx . . $ `ubifs-utils/fsck.ubifs/fsck.ubifs.h:9:9`! |
| 10 | |
| 11 | /* Exit codes used by fsck-type programs */ |
| 12 | #define FSCK_OKcxx . . $ `ubifs-utils/fsck.ubifs/fsck.ubifs.h:12:9`! 0 /* No errors */ |
| 13 | #define FSCK_NONDESTRUCTcxx . . $ `ubifs-utils/fsck.ubifs/fsck.ubifs.h:13:9`! 1 /* File system errors corrected */ |
| 14 | #define FSCK_REBOOTcxx . . $ `ubifs-utils/fsck.ubifs/fsck.ubifs.h:14:9`! 2 /* System should be rebooted */ |
| 15 | #define FSCK_UNCORRECTEDcxx . . $ `ubifs-utils/fsck.ubifs/fsck.ubifs.h:15:9`! 4 /* File system errors left uncorrected */ |
| 16 | #define FSCK_ERRORcxx . . $ `ubifs-utils/fsck.ubifs/fsck.ubifs.h:16:9`! 8 /* Operational error */ |
| 17 | #define FSCK_USAGEcxx . . $ `ubifs-utils/fsck.ubifs/fsck.ubifs.h:17:9`! 16 /* Usage or syntax error */ |
| 18 | #define FSCK_CANCELEDcxx . . $ `ubifs-utils/fsck.ubifs/fsck.ubifs.h:18:9`! 32 /* Aborted with a signal or ^C */ |
| 19 | #define FSCK_LIBRARYcxx . . $ `ubifs-utils/fsck.ubifs/fsck.ubifs.h:19:9`! 128 /* Shared library error */ |
| 20 | |
| 21 | /* |
| 22 | * There are 6 working modes for fsck: |
| 23 | * NORMAL_MODE: Check the filesystem, ask user whether or not to fix the |
| 24 | * problem as long as inconsistent data is found during checking. |
| 25 | * SAFE_MODE: Check and safely repair the filesystem, if there are any |
| 26 | * data dropping operations needed by fixing, fsck will fail. |
| 27 | * DANGER_MODE0:Check and repair the filesystem according to TNC, data dropping |
| 28 | * will be reported. If TNC/master/log is corrupted, fsck will fail. |
| 29 | * DANGER_MODE1:Check and forcedly repair the filesystem according to TNC, |
| 30 | * turns to @REBUILD_MODE mode automatically if TNC/master/log is |
| 31 | * corrupted. |
| 32 | * REBUILD_MODE:Scan entire UBI volume to find all nodes, and rebuild the |
| 33 | * filesystem, always make fsck success. |
| 34 | * CHECK_MODE: Make no changes to the filesystem, only check the filesystem. |
| 35 | */ |
| 36 | enumcxx . . $ $anonymous_type_b667e2f594e79668_0# { NORMAL_MODEcxx . . $ NORMAL_MODE. = 0, SAFE_MODEcxx . . $ SAFE_MODE., DANGER_MODE0cxx . . $ DANGER_MODE0., |
| 37 | DANGER_MODE1cxx . . $ DANGER_MODE1., REBUILD_MODEcxx . . $ REBUILD_MODE., CHECK_MODEcxx . . $ CHECK_MODE. }; |
| 38 | |
| 39 | /* Types of inconsistent problems */ |
| 40 | enumcxx . . $ $anonymous_type_b667e2f594e79668_1# { SB_CORRUPTEDcxx . . $ SB_CORRUPTED. = 0, MST_CORRUPTEDcxx . . $ MST_CORRUPTED., LOG_CORRUPTEDcxx . . $ LOG_CORRUPTED., BUD_CORRUPTEDcxx . . $ BUD_CORRUPTED., |
| 41 | TNC_CORRUPTEDcxx . . $ TNC_CORRUPTED., TNC_DATA_CORRUPTEDcxx . . $ TNC_DATA_CORRUPTED., ORPHAN_CORRUPTEDcxx . . $ ORPHAN_CORRUPTED., INVALID_INO_NODEcxx . . $ INVALID_INO_NODE., |
| 42 | INVALID_DENT_NODEcxx . . $ INVALID_DENT_NODE., INVALID_DATA_NODEcxx . . $ INVALID_DATA_NODE., SCAN_CORRUPTEDcxx . . $ SCAN_CORRUPTED., FILE_HAS_NO_INODEcxx . . $ FILE_HAS_NO_INODE., |
| 43 | FILE_HAS_0_NLINK_INODEcxx . . $ FILE_HAS_0_NLINK_INODE., FILE_HAS_INCONSIST_TYPEcxx . . $ FILE_HAS_INCONSIST_TYPE., FILE_HAS_TOO_MANY_DENTcxx . . $ FILE_HAS_TOO_MANY_DENT., |
| 44 | FILE_SHOULDNT_HAVE_DATAcxx . . $ FILE_SHOULDNT_HAVE_DATA., FILE_HAS_NO_DENTcxx . . $ FILE_HAS_NO_DENT., XATTR_HAS_NO_HOSTcxx . . $ XATTR_HAS_NO_HOST., |
| 45 | XATTR_HAS_WRONG_HOSTcxx . . $ XATTR_HAS_WRONG_HOST., FILE_HAS_NO_ENCRYPTcxx . . $ FILE_HAS_NO_ENCRYPT., FILE_IS_DISCONNECTEDcxx . . $ FILE_IS_DISCONNECTED., |
| 46 | FILE_ROOT_HAS_DENTcxx . . $ FILE_ROOT_HAS_DENT., DENTRY_IS_UNREACHABLEcxx . . $ DENTRY_IS_UNREACHABLE., FILE_IS_INCONSISTENTcxx . . $ FILE_IS_INCONSISTENT., |
| 47 | EMPTY_TNCcxx . . $ EMPTY_TNC., LPT_CORRUPTEDcxx . . $ LPT_CORRUPTED., NNODE_INCORRECTcxx . . $ NNODE_INCORRECT., PNODE_INCORRECTcxx . . $ PNODE_INCORRECT., |
| 48 | LP_INCORRECTcxx . . $ LP_INCORRECT., SPACE_STAT_INCORRECTcxx . . $ SPACE_STAT_INCORRECT., LTAB_INCORRECTcxx . . $ LTAB_INCORRECT., INCORRECT_IDX_SZcxx . . $ INCORRECT_IDX_SZ., |
| 49 | ROOT_DIR_NOT_FOUNDcxx . . $ ROOT_DIR_NOT_FOUND., DISCONNECTED_FILE_CANNOT_BE_RECOVEREDcxx . . $ DISCONNECTED_FILE_CANNOT_BE_RECOVERED. }; |
| 50 | |
| 51 | enumcxx . . $ $anonymous_type_b667e2f594e79668_2# { HAS_DATA_CORRUPTEDcxx . . $ HAS_DATA_CORRUPTED. = 1, HAS_TNC_CORRUPTEDcxx . . $ HAS_TNC_CORRUPTED. = 2 }; |
| 52 | |
| 53 | typedef int (*calculate_lp_callbackcxx . . $ calculate_lp_callback#)(struct ubifs_infocxx . . $ ubifs_info# *c, |
| 54 | int index, int *free, int *dirty, |
| 55 | int *is_idx); |
| 56 | |
| 57 | struct scanned_filecxx . . $ scanned_file#; |
| 58 | |
| 59 | /** |
| 60 | * scanned_node - common header node. |
| 61 | * @exist: whether the node is found by scanning |
| 62 | * @lnum: LEB number of the scanned node |
| 63 | * @offs: scanned node's offset within @lnum |
| 64 | * @len: length of scanned node |
| 65 | * @sqnum: sequence number |
| 66 | */ |
| 67 | struct scanned_nodecxx . . $ scanned_node# { |
| 68 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! existcxx . . $ scanned_node#exist.; |
| 69 | int lnumcxx . . $ scanned_node#lnum.; |
| 70 | int offscxx . . $ scanned_node#offs.; |
| 71 | int lencxx . . $ scanned_node#len.; |
| 72 | unsigned long long sqnumcxx . . $ scanned_node#sqnum.; |
| 73 | }; |
| 74 | |
| 75 | /** |
| 76 | * scanned_ino_node - scanned inode node. |
| 77 | * @header: common header of scanned node |
| 78 | * @key: the key of inode node |
| 79 | * @is_xattr: %1 for xattr inode, otherwise %0 |
| 80 | * @is_encrypted: %1 for encrypted inode, otherwise %0 |
| 81 | * @mode: file mode |
| 82 | * @nlink: number of hard links |
| 83 | * @xcnt: count of extended attributes this inode has |
| 84 | * @xsz: summarized size of all extended attributes in bytes |
| 85 | * @xnms: sum of lengths of all extended attribute names |
| 86 | * @size: inode size in bytes |
| 87 | * @rb: link in the tree of valid inode nodes or deleted inode nodes |
| 88 | */ |
| 89 | struct scanned_ino_nodecxx . . $ scanned_ino_node# { |
| 90 | struct scanned_nodecxx . . $ scanned_node# headercxx . . $ scanned_ino_node#header.; |
| 91 | union ubifs_keycxx . . $ ubifs_key# keycxx . . $ scanned_ino_node#key.; |
| 92 | unsigned int is_xattrcxx . . $ scanned_ino_node#is_xattr.:1; |
| 93 | unsigned int is_encryptedcxx . . $ scanned_ino_node#is_encrypted.:1; |
| 94 | unsigned int modecxx . . $ scanned_ino_node#mode.; |
| 95 | unsigned int nlinkcxx . . $ scanned_ino_node#nlink.; |
| 96 | unsigned int xcntcxx . . $ scanned_ino_node#xcnt.; |
| 97 | unsigned int xszcxx . . $ scanned_ino_node#xsz.; |
| 98 | unsigned int xnmscxx . . $ scanned_ino_node#xnms.; |
| 99 | unsigned long long sizecxx . . $ scanned_ino_node#size.; |
| 100 | struct rb_nodecxx . . $ rb_node# rbcxx . . $ scanned_ino_node#rb.; |
| 101 | }; |
| 102 | |
| 103 | /** |
| 104 | * scanned_dent_node - scanned dentry node. |
| 105 | * @header: common header of scanned node |
| 106 | * @key: the key of dentry node |
| 107 | * @can_be_found: whether this dentry can be found from '/' |
| 108 | * @type: file type, reg/dir/symlink/block/char/fifo/sock |
| 109 | * @nlen: name length |
| 110 | * @name: dentry name |
| 111 | * @inum: target inode number |
| 112 | * @file: corresponding file |
| 113 | * @rb: link in the trees of: |
| 114 | * 1) valid dentry nodes or deleted dentry node |
| 115 | * 2) all scanned dentry nodes from same file |
| 116 | * @list: link in the list dentries for looking up/deleting |
| 117 | */ |
| 118 | struct scanned_dent_nodecxx . . $ scanned_dent_node# { |
| 119 | struct scanned_nodecxx . . $ scanned_node# headercxx . . $ scanned_dent_node#header.; |
| 120 | union ubifs_keycxx . . $ ubifs_key# keycxx . . $ scanned_dent_node#key.; |
| 121 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! can_be_foundcxx . . $ scanned_dent_node#can_be_found.; |
| 122 | unsigned int typecxx . . $ scanned_dent_node#type.; |
| 123 | unsigned int nlencxx . . $ scanned_dent_node#nlen.; |
| 124 | char namecxx . . $ scanned_dent_node#name.[UBIFS_MAX_NLENcxx . . $ `ubifs-utils/libubifs/ubifs-media.h:95:9`! + 1]; |
| 125 | ino_tcxx . . $ ino_t# inumcxx . . $ scanned_dent_node#inum.; |
| 126 | struct scanned_filecxx . . $ scanned_file# *filecxx . . $ scanned_dent_node#file.; |
| 127 | struct rb_nodecxx . . $ rb_node# rbcxx . . $ scanned_dent_node#rb.; |
| 128 | struct list_headcxx . . $ list_head# listcxx . . $ scanned_dent_node#list.; |
| 129 | }; |
| 130 | |
| 131 | /** |
| 132 | * scanned_data_node - scanned data node. |
| 133 | * @header: common header of scanned node |
| 134 | * @key: the key of data node |
| 135 | * @size: uncompressed data size in bytes |
| 136 | * @rb: link in the tree of all scanned data nodes from same file |
| 137 | * @list: link in the list for deleting |
| 138 | */ |
| 139 | struct scanned_data_nodecxx . . $ scanned_data_node# { |
| 140 | struct scanned_nodecxx . . $ scanned_node# headercxx . . $ scanned_data_node#header.; |
| 141 | union ubifs_keycxx . . $ ubifs_key# keycxx . . $ scanned_data_node#key.; |
| 142 | unsigned int sizecxx . . $ scanned_data_node#size.; |
| 143 | struct rb_nodecxx . . $ rb_node# rbcxx . . $ scanned_data_node#rb.; |
| 144 | struct list_headcxx . . $ list_head# listcxx . . $ scanned_data_node#list.; |
| 145 | }; |
| 146 | |
| 147 | /** |
| 148 | * scanned_trun_node - scanned truncation node. |
| 149 | * @header: common header of scanned node |
| 150 | * @new_size: size after truncation |
| 151 | */ |
| 152 | struct scanned_trun_nodecxx . . $ scanned_trun_node# { |
| 153 | struct scanned_nodecxx . . $ scanned_node# headercxx . . $ scanned_trun_node#header.; |
| 154 | unsigned long long new_sizecxx . . $ scanned_trun_node#new_size.; |
| 155 | }; |
| 156 | |
| 157 | /** |
| 158 | * scanned_file - file info scanned from UBIFS volume. |
| 159 | * |
| 160 | * @calc_nlink: calculated count of directory entries refer this inode |
| 161 | * @calc_xcnt: calculated count of extended attributes |
| 162 | * @calc_xsz: calculated summary size of all extended attributes |
| 163 | * @calc_xnms: calculated sum of lengths of all extended attribute names |
| 164 | * @calc_size: calculated file size |
| 165 | * @has_encrypted_info: whether the file has encryption related xattrs |
| 166 | * |
| 167 | * @inum: inode number |
| 168 | * @ino: inode node |
| 169 | * @trun: truncation node |
| 170 | * |
| 171 | * @rb: link in the tree of all scanned files |
| 172 | * @list: link in the list files for kinds of processing |
| 173 | * @dent_nodes: tree of all scanned dentry nodes |
| 174 | * @data_nodes: tree of all scanned data nodes |
| 175 | * @xattr_files: tree of all scanned xattr files |
| 176 | */ |
| 177 | struct scanned_filecxx . . $ scanned_file# { |
| 178 | unsigned int calc_nlinkcxx . . $ scanned_file#calc_nlink.; |
| 179 | unsigned int calc_xcntcxx . . $ scanned_file#calc_xcnt.; |
| 180 | unsigned int calc_xszcxx . . $ scanned_file#calc_xsz.; |
| 181 | unsigned int calc_xnmscxx . . $ scanned_file#calc_xnms.; |
| 182 | unsigned long long calc_sizecxx . . $ scanned_file#calc_size.; |
| 183 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! has_encrypted_infocxx . . $ scanned_file#has_encrypted_info.; |
| 184 | |
| 185 | ino_tcxx . . $ ino_t# inumcxx . . $ scanned_file#inum.; |
| 186 | struct scanned_ino_nodecxx . . $ scanned_ino_node# inocxx . . $ scanned_file#ino.; |
| 187 | struct scanned_trun_nodecxx . . $ scanned_trun_node# truncxx . . $ scanned_file#trun.; |
| 188 | |
| 189 | struct rb_nodecxx . . $ rb_node# rbcxx . . $ scanned_file#rb.; |
| 190 | struct list_headcxx . . $ list_head# listcxx . . $ scanned_file#list.; |
| 191 | struct rb_rootcxx . . $ rb_root# dent_nodescxx . . $ scanned_file#dent_nodes.; |
| 192 | struct rb_rootcxx . . $ rb_root# data_nodescxx . . $ scanned_file#data_nodes.; |
| 193 | struct rb_rootcxx . . $ rb_root# xattr_filescxx . . $ scanned_file#xattr_files.; |
| 194 | }; |
| 195 | |
| 196 | /** |
| 197 | * invalid_file_problem - problem instance for invalid file. |
| 198 | * @file: invalid file instance |
| 199 | * @priv: invalid instance in @file, could be a dent_node or data_node |
| 200 | */ |
| 201 | struct invalid_file_problemcxx . . $ invalid_file_problem# { |
| 202 | struct scanned_filecxx . . $ scanned_file# *filecxx . . $ invalid_file_problem#file.; |
| 203 | void *privcxx . . $ invalid_file_problem#priv.; |
| 204 | }; |
| 205 | |
| 206 | /** |
| 207 | * nnode_problem - problem instance for incorrect nnode |
| 208 | * @nnode: incorrect nnode |
| 209 | * @parent_nnode: the parent nnode of @nnode, could be NULL if @nnode is root |
| 210 | * @num: calculated num |
| 211 | */ |
| 212 | struct nnode_problemcxx . . $ nnode_problem# { |
| 213 | struct ubifs_nnodecxx . . $ ubifs_nnode# *nnodecxx . . $ nnode_problem#nnode.; |
| 214 | struct ubifs_nnodecxx . . $ ubifs_nnode# *parent_nnodecxx . . $ nnode_problem#parent_nnode.; |
| 215 | int numcxx . . $ nnode_problem#num.; |
| 216 | }; |
| 217 | |
| 218 | /** |
| 219 | * pnode_problem - problem instance for incorrect pnode |
| 220 | * @pnode: incorrect pnode |
| 221 | * @num: calculated num |
| 222 | */ |
| 223 | struct pnode_problemcxx . . $ pnode_problem# { |
| 224 | struct ubifs_pnodecxx . . $ ubifs_pnode# *pnodecxx . . $ pnode_problem#pnode.; |
| 225 | int numcxx . . $ pnode_problem#num.; |
| 226 | }; |
| 227 | |
| 228 | /** |
| 229 | * lp_problem - problem instance for incorrect LEB proerties |
| 230 | * @lp: incorrect LEB properties |
| 231 | * @lnum: LEB number |
| 232 | * @free: calculated free space in LEB |
| 233 | * @dirty: calculated dirty bytes in LEB |
| 234 | * @is_idx: %true means that the LEB is an index LEB |
| 235 | */ |
| 236 | struct lp_problemcxx . . $ lp_problem# { |
| 237 | struct ubifs_lpropscxx . . $ ubifs_lprops# *lpcxx . . $ lp_problem#lp.; |
| 238 | int lnumcxx . . $ lp_problem#lnum.; |
| 239 | int freecxx . . $ lp_problem#free.; |
| 240 | int dirtycxx . . $ lp_problem#dirty.; |
| 241 | int is_idxcxx . . $ lp_problem#is_idx.; |
| 242 | }; |
| 243 | |
| 244 | /** |
| 245 | * space_stat_problem - problem instance for incorrect space statistics |
| 246 | * @lst: current space statistics |
| 247 | * @calc_lst: calculated space statistics |
| 248 | */ |
| 249 | struct space_stat_problemcxx . . $ space_stat_problem# { |
| 250 | struct ubifs_lp_statscxx . . $ ubifs_lp_stats# *lstcxx . . $ space_stat_problem#lst.; |
| 251 | struct ubifs_lp_statscxx . . $ ubifs_lp_stats# *calc_lstcxx . . $ space_stat_problem#calc_lst.; |
| 252 | }; |
| 253 | |
| 254 | /** |
| 255 | * ubifs_rebuild_info - UBIFS rebuilding information. |
| 256 | * @write_buf: write buffer for LEB @head_lnum |
| 257 | * @head_lnum: current writing LEB number |
| 258 | * @head_offs: current writing position in LEB @head_lnum |
| 259 | * @need_update_lpt: whether to update lpt while writing index nodes |
| 260 | */ |
| 261 | struct ubifs_rebuild_infocxx . . $ ubifs_rebuild_info# { |
| 262 | void *write_bufcxx . . $ ubifs_rebuild_info#write_buf.; |
| 263 | int head_lnumcxx . . $ ubifs_rebuild_info#head_lnum.; |
| 264 | int head_offscxx . . $ ubifs_rebuild_info#head_offs.; |
| 265 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! need_update_lptcxx . . $ ubifs_rebuild_info#need_update_lpt.; |
| 266 | }; |
| 267 | |
| 268 | /** |
| 269 | * struct ubifs_fsck_info - UBIFS fsck information. |
| 270 | * @mode: working mode |
| 271 | * @failure_reason: reasons for failed operations |
| 272 | * @lpt_status: the status of lpt, could be: %0(OK), %FR_LPT_CORRUPTED or |
| 273 | * %FR_LPT_INCORRECT |
| 274 | * @scanned_files: tree of all scanned files |
| 275 | * @used_lebs: a bitmap used for recording used lebs |
| 276 | * @disconnected_files: regular files without dentries |
| 277 | * @lpts: lprops table |
| 278 | * @try_rebuild: %true means that try to rebuild fs when fsck failed |
| 279 | * @rebuild: rebuilding-related information |
| 280 | * @lost_and_found: inode number of the lost+found directory, %0 means invalid |
| 281 | */ |
| 282 | struct ubifs_fsck_infocxx . . $ ubifs_fsck_info# { |
| 283 | int modecxx . . $ ubifs_fsck_info#mode.; |
| 284 | unsigned int failure_reasoncxx . . $ ubifs_fsck_info#failure_reason.; |
| 285 | unsigned int lpt_statuscxx . . $ ubifs_fsck_info#lpt_status.; |
| 286 | struct rb_rootcxx . . $ rb_root# scanned_filescxx . . $ ubifs_fsck_info#scanned_files.; |
| 287 | unsigned long *used_lebscxx . . $ ubifs_fsck_info#used_lebs.; |
| 288 | struct list_headcxx . . $ list_head# disconnected_filescxx . . $ ubifs_fsck_info#disconnected_files.; |
| 289 | struct ubifs_lpropscxx . . $ ubifs_lprops# *lptscxx . . $ ubifs_fsck_info#lpts.; |
| 290 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! try_rebuildcxx . . $ ubifs_fsck_info#try_rebuild.; |
| 291 | struct ubifs_rebuild_infocxx . . $ ubifs_rebuild_info# *rebuildcxx . . $ ubifs_fsck_info#rebuild.; |
| 292 | ino_tcxx . . $ ino_t# lost_and_foundcxx . . $ ubifs_fsck_info#lost_and_found.; |
| 293 | }; |
| 294 | |
| 295 | #define FSCKcxx . . $ `ubifs-utils/fsck.ubifs/fsck.ubifs.h:295:9`!(c) ((struct ubifs_fsck_info*)c->private) |
| 296 | |
| 297 | static inline const char *mode_namecxx . . $ mode_name(a0b7517af24f242a).(const struct ubifs_infocxx . . $ ubifs_info# *c) |
| 298 | { |
| 299 | if (!c->privatecxx . . $ ubifs_info#private.) |
| 300 | return ""; |
| 301 | |
| 302 | switch (FSCKcxx . . $ `ubifs-utils/fsck.ubifs/fsck.ubifs.h:295:9`!(c)->modecxx . . $ ubifs_fsck_info#mode.) { |
| 303 | case NORMAL_MODEcxx . . $ NORMAL_MODE.: |
| 304 | return ",normal mode"; |
| 305 | case SAFE_MODEcxx . . $ SAFE_MODE.: |
| 306 | return ",safe mode"; |
| 307 | case DANGER_MODE0cxx . . $ DANGER_MODE0.: |
| 308 | return ",danger mode"; |
| 309 | case DANGER_MODE1cxx . . $ DANGER_MODE1.: |
| 310 | return ",danger + rebuild mode"; |
| 311 | case REBUILD_MODEcxx . . $ REBUILD_MODE.: |
| 312 | return ",rebuild mode"; |
| 313 | case CHECK_MODEcxx . . $ CHECK_MODE.: |
| 314 | return ",check mode"; |
| 315 | default: |
| 316 | return ""; |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | #define log_outcxx . . $ `ubifs-utils/fsck.ubifs/fsck.ubifs.h:320:9`!(c, fmt, ...) \ |
| 321 | printf("%s[%d] (%s%s): " fmt "\n", c->program_name ? : "noprog",\ |
| 322 | getpid(), c->dev_name ? : "-", mode_name(c), \ |
| 323 | ##__VA_ARGS__) |
| 324 | |
| 325 | #define log_errcxx . . $ `ubifs-utils/fsck.ubifs/fsck.ubifs.h:325:9`!(c, err, fmt, ...) do { \ |
| 326 | printf("%s[%d][ERROR] (%s%s): %s: " fmt, \ |
| 327 | c->program_name ? : "noprog", getpid(), \ |
| 328 | c->dev_name ? : "-", mode_name(c), \ |
| 329 | __FUNCTION__, ##__VA_ARGS__); \ |
| 330 | if (err) \ |
| 331 | printf(" - %s", strerror(err)); \ |
| 332 | printf("\n"); \ |
| 333 | } while (0) |
| 334 | |
| 335 | /* Exit code for fsck program. */ |
| 336 | extern int exit_codecxx . . $ exit_code.; |
| 337 | |
| 338 | /* fsck.ubifs.c */ |
| 339 | void handle_errorcxx . . $ handle_error(d2e0d634f4c4e78c).(const struct ubifs_infocxx . . $ ubifs_info# *c, int reason_set); |
| 340 | |
| 341 | /* problem.c */ |
| 342 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! fix_problemcxx . . $ fix_problem(396d3ecac4a41a3c).(const struct ubifs_infocxx . . $ ubifs_info# *c, int problem_type, const void *priv); |
| 343 | |
| 344 | /* load_fs.c */ |
| 345 | int ubifs_load_filesystemcxx . . $ ubifs_load_filesystem(5b96fa653392f373).(struct ubifs_infocxx . . $ ubifs_info# *c); |
| 346 | void ubifs_destroy_filesystemcxx . . $ ubifs_destroy_filesystem(ecc28300d9798099).(struct ubifs_infocxx . . $ ubifs_info# *c); |
| 347 | |
| 348 | /* extract_files.c */ |
| 349 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! parse_ino_nodecxx . . $ parse_ino_node(e3dc07ae6947a9fb).(struct ubifs_infocxx . . $ ubifs_info# *c, int lnum, int offs, void *node, |
| 350 | union ubifs_keycxx . . $ ubifs_key# *key, struct scanned_ino_nodecxx . . $ scanned_ino_node# *ino_node); |
| 351 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! parse_dent_nodecxx . . $ parse_dent_node(e9084287ec5d8244).(struct ubifs_infocxx . . $ ubifs_info# *c, int lnum, int offs, void *node, |
| 352 | union ubifs_keycxx . . $ ubifs_key# *key, struct scanned_dent_nodecxx . . $ scanned_dent_node# *dent_node); |
| 353 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! parse_data_nodecxx . . $ parse_data_node(8c8c6845aa1762a9).(struct ubifs_infocxx . . $ ubifs_info# *c, int lnum, int offs, void *node, |
| 354 | union ubifs_keycxx . . $ ubifs_key# *key, struct scanned_data_nodecxx . . $ scanned_data_node# *data_node); |
| 355 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! parse_trun_nodecxx . . $ parse_trun_node(541993dc70a308f3).(struct ubifs_infocxx . . $ ubifs_info# *c, int lnum, int offs, void *node, |
| 356 | union ubifs_keycxx . . $ ubifs_key# *key, struct scanned_trun_nodecxx . . $ scanned_trun_node# *trun_node); |
| 357 | int insert_or_update_filecxx . . $ insert_or_update_file(3d3943cf134bc20e).(struct ubifs_infocxx . . $ ubifs_info# *c, struct rb_rootcxx . . $ rb_root# *file_tree, |
| 358 | struct scanned_nodecxx . . $ scanned_node# *sn, int key_type, ino_tcxx . . $ ino_t# inum); |
| 359 | void destroy_file_contentcxx . . $ destroy_file_content(7030c665ce098f51).(struct ubifs_infocxx . . $ ubifs_info# *c, struct scanned_filecxx . . $ scanned_file# *file); |
| 360 | void destroy_file_treecxx . . $ destroy_file_tree(a8817465b05ea06).(struct ubifs_infocxx . . $ ubifs_info# *c, struct rb_rootcxx . . $ rb_root# *file_tree); |
| 361 | void destroy_file_listcxx . . $ destroy_file_list(2c6457ab04692ad2).(struct ubifs_infocxx . . $ ubifs_info# *c, struct list_headcxx . . $ list_head# *file_list); |
| 362 | struct scanned_filecxx . . $ scanned_file# *lookup_filecxx . . $ lookup_file(134a2afd08f09a14).(struct rb_rootcxx . . $ rb_root# *file_tree, ino_tcxx . . $ ino_t# inum); |
| 363 | int delete_filecxx . . $ delete_file(bff891fb0656fd64).(struct ubifs_infocxx . . $ ubifs_info# *c, struct scanned_filecxx . . $ scanned_file# *file); |
| 364 | int file_is_validcxx . . $ file_is_valid(ef59cc6a8984d4e7).(struct ubifs_infocxx . . $ ubifs_info# *c, struct scanned_filecxx . . $ scanned_file# *file, |
| 365 | struct rb_rootcxx . . $ rb_root# *file_tree, int *is_diconnected); |
| 366 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! file_is_reachablecxx . . $ file_is_reachable(f840b42ecdf41fab).(struct ubifs_infocxx . . $ ubifs_info# *c, struct scanned_filecxx . . $ scanned_file# *file, |
| 367 | struct rb_rootcxx . . $ rb_root# *file_tree); |
| 368 | int check_and_correct_filescxx . . $ check_and_correct_files(5b96fa653392f373).(struct ubifs_infocxx . . $ ubifs_info# *c); |
| 369 | |
| 370 | /* rebuild_fs.c */ |
| 371 | int ubifs_rebuild_filesystemcxx . . $ ubifs_rebuild_filesystem(5b96fa653392f373).(struct ubifs_infocxx . . $ ubifs_info# *c); |
| 372 | |
| 373 | /* check_files.c */ |
| 374 | int traverse_tnc_and_construct_filescxx . . $ traverse_tnc_and_construct_files(5b96fa653392f373).(struct ubifs_infocxx . . $ ubifs_info# *c); |
| 375 | void update_files_sizecxx . . $ update_files_size(ecc28300d9798099).(struct ubifs_infocxx . . $ ubifs_info# *c); |
| 376 | int handle_invalid_filescxx . . $ handle_invalid_files(5b96fa653392f373).(struct ubifs_infocxx . . $ ubifs_info# *c); |
| 377 | int handle_dentry_treecxx . . $ handle_dentry_tree(5b96fa653392f373).(struct ubifs_infocxx . . $ ubifs_info# *c); |
| 378 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! tnc_is_emptycxx . . $ tnc_is_empty(d56038550ce159bd).(struct ubifs_infocxx . . $ ubifs_info# *c); |
| 379 | int check_and_create_rootcxx . . $ check_and_create_root(5b96fa653392f373).(struct ubifs_infocxx . . $ ubifs_info# *c); |
| 380 | |
| 381 | /* check_space.c */ |
| 382 | int get_free_lebcxx . . $ get_free_leb(5b96fa653392f373).(struct ubifs_infocxx . . $ ubifs_info# *c); |
| 383 | int build_lptcxx . . $ build_lpt(1dd1d53e22f22c6e).(struct ubifs_infocxx . . $ ubifs_info# *c, calculate_lp_callbackcxx . . $ calculate_lp_callback# calculate_lp_cb, |
| 384 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! free_ltab); |
| 385 | int check_and_correct_spacecxx . . $ check_and_correct_space(5b96fa653392f373).(struct ubifs_infocxx . . $ ubifs_info# *c); |
| 386 | int check_and_correct_index_sizecxx . . $ check_and_correct_index_size(5b96fa653392f373).(struct ubifs_infocxx . . $ ubifs_info# *c); |
| 387 | |
| 388 | /* handle_disconnected.c */ |
| 389 | int check_and_create_lost_foundcxx . . $ check_and_create_lost_found(5b96fa653392f373).(struct ubifs_infocxx . . $ ubifs_info# *c); |
| 390 | int handle_disonnected_filescxx . . $ handle_disonnected_files(5b96fa653392f373).(struct ubifs_infocxx . . $ ubifs_info# *c); |
| 391 | |
| 392 | #endif |