Linux Kernel
3.7.1
|
Go to the source code of this file.
Data Structures | |
struct | size_entry |
Functions | |
int | ubifs_recover_master_node (struct ubifs_info *c) |
int | ubifs_write_rcvrd_mst_node (struct ubifs_info *c) |
struct ubifs_scan_leb * | ubifs_recover_leb (struct ubifs_info *c, int lnum, int offs, void *sbuf, int jhead) |
struct ubifs_scan_leb * | ubifs_recover_log_leb (struct ubifs_info *c, int lnum, int offs, void *sbuf) |
int | ubifs_recover_inl_heads (struct ubifs_info *c, void *sbuf) |
int | ubifs_clean_lebs (struct ubifs_info *c, void *sbuf) |
int | ubifs_rcvry_gc_commit (struct ubifs_info *c) |
void | ubifs_destroy_size_tree (struct ubifs_info *c) |
int | ubifs_recover_size_accum (struct ubifs_info *c, union ubifs_key *key, int deletion, loff_t new_size) |
int | ubifs_recover_size (struct ubifs_info *c) |
int ubifs_clean_lebs | ( | struct ubifs_info * | c, |
void * | sbuf | ||
) |
ubifs_clean_lebs - clean LEBs recovered during read-only mount. : UBIFS file-system description object : LEB-sized buffer to use
This function cleans a LEB identified during recovery that needs to be written but was not because UBIFS was mounted read-only. This happens when remounting to read-write mode.
This function returns %0 on success and a negative error code on failure.
Definition at line 1094 of file recovery.c.
void ubifs_destroy_size_tree | ( | struct ubifs_info * | c | ) |
ubifs_destroy_size_tree - free resources related to the size tree. : UBIFS file-system description object
Definition at line 1336 of file recovery.c.
int ubifs_rcvry_gc_commit | ( | struct ubifs_info * | c | ) |
ubifs_rcvry_gc_commit - recover the GC LEB number and run the commit. : UBIFS file-system description object
Out-of-place garbage collection requires always one empty LEB with which to start garbage collection. The LEB number is recorded in c->gc_lnum and is written to the master node on unmounting. In the case of an unclean unmount the value of gc_lnum recorded in the master node is out of date and cannot be used. Instead, recovery must allocate an empty LEB for this purpose. However, there may not be enough empty space, in which case it must be possible to GC the dirtiest LEB into the GC head LEB.
This function also runs the commit which causes the TNC updates from size-recovery and orphans to be written to the flash. That is important to ensure correct replay order for subsequent mounts.
This function returns %0 on success and a negative error code on failure.
Definition at line 1177 of file recovery.c.
int ubifs_recover_inl_heads | ( | struct ubifs_info * | c, |
void * | sbuf | ||
) |
ubifs_recover_inl_heads - recover index and LPT heads. : UBIFS file-system description object : LEB-sized buffer to use
This function ensures that there is no data on the flash at the index and LPT head locations.
This deals with the recovery of a half-completed journal commit. UBIFS is careful never to overwrite the last version of the index or the LPT. Because the index and LPT are wandering trees, data from a half-completed commit will not be referenced anywhere in UBIFS. The data will be either in LEBs that are assumed to be empty and will be unmapped anyway before use, or in the index and LPT heads.
This function returns %0 on success and a negative error code on failure.
Definition at line 967 of file recovery.c.
|
read |
ubifs_recover_leb - scan and recover a LEB. : UBIFS file-system description object : LEB number : offset : LEB-sized buffer to use : journal head number this LEB belongs to (%-1 if the LEB does not belong to any journal head)
This function does a scan of a LEB, but caters for errors that might have been caused by the unclean unmount from which we are attempting to recover. Returns %0 in case of success, %-EUCLEAN if an unrecoverable corruption is found, and a negative error code in case of failure.
Definition at line 635 of file recovery.c.
|
read |
ubifs_recover_log_leb - scan and recover a log LEB. : UBIFS file-system description object : LEB number : offset : LEB-sized buffer to use
This function does a scan of a LEB, but caters for errors that might have been caused by unclean reboots from which we are attempting to recover (assume that only the last log LEB can be corrupted by an unclean reboot).
This function returns %0 on success and a negative error code on failure.
Definition at line 869 of file recovery.c.
int ubifs_recover_master_node | ( | struct ubifs_info * | c | ) |
ubifs_recover_master_node - recover the master node. : UBIFS file-system description object
This function recovers the master node from corruption that may occur due to an unclean unmount.
This function returns %0 on success and a negative error code on failure.
Definition at line 236 of file recovery.c.
int ubifs_recover_size | ( | struct ubifs_info * | c | ) |
ubifs_recover_size - recover inode size. : UBIFS file-system description object
This function attempts to fix inode size discrepancies identified by the 'ubifs_recover_size_accum()' function.
This functions returns %0 on success and a negative error code on failure.
Definition at line 1497 of file recovery.c.
int ubifs_recover_size_accum | ( | struct ubifs_info * | c, |
union ubifs_key * | key, | ||
int | deletion, | ||
loff_t | new_size | ||
) |
ubifs_recover_size_accum - accumulate inode sizes for recovery. : UBIFS file-system description object : node key : node is for a deletion : inode size
This function has two purposes: 1) to ensure there are no data nodes that fall outside the inode size 2) to ensure there are no data nodes for inodes that do not exist To accomplish those purposes, a rb-tree is constructed containing an entry for each inode number in the journal that has not been deleted, and recording the size from the inode node, the maximum size of any data node (also altered by truncations) and a flag indicating a inode number for which no inode node was present in the journal.
Note that there is still the possibility that there are data nodes that have been committed that are beyond the inode size, however the only way to find them would be to scan the entire index. Alternatively, some provision could be made to record the size of inodes at the start of commit, which would seem very cumbersome for a scenario that is quite unlikely and the only negative consequence of which is wasted space.
This functions returns %0 on success and a negative error code on failure.
Definition at line 1389 of file recovery.c.
int ubifs_write_rcvrd_mst_node | ( | struct ubifs_info * | c | ) |
ubifs_write_rcvrd_mst_node - write the recovered master node. : UBIFS file-system description object
This function writes the master node that was recovered during mounting in read-only mode and must now be written because we are remounting rw.
This function returns %0 on success and a negative error code on failure.
Definition at line 386 of file recovery.c.