Linux Kernel
3.7.1
|
#include "ubifs.h"
Go to the source code of this file.
Data Structures | |
struct | done_ref |
Functions | |
struct ubifs_bud * | ubifs_search_bud (struct ubifs_info *c, int lnum) |
struct ubifs_wbuf * | ubifs_get_wbuf (struct ubifs_info *c, int lnum) |
void | ubifs_add_bud (struct ubifs_info *c, struct ubifs_bud *bud) |
int | ubifs_add_bud_to_log (struct ubifs_info *c, int jhead, int lnum, int offs) |
int | ubifs_log_start_commit (struct ubifs_info *c, int *ltail_lnum) |
int | ubifs_log_end_commit (struct ubifs_info *c, int ltail_lnum) |
int | ubifs_log_post_commit (struct ubifs_info *c, int old_ltail_lnum) |
int | ubifs_consolidate_log (struct ubifs_info *c) |
void ubifs_add_bud | ( | struct ubifs_info * | c, |
struct ubifs_bud * | bud | ||
) |
ubifs_add_bud_to_log - add a new bud to the log. : UBIFS file-system description object : journal head the bud belongs to : LEB number of the bud : starting offset of the bud
This function writes reference node for the new bud LEB it to the log, and adds it to the buds tress. It also makes sure that log size does not exceed the 'c->max_bud_bytes' limit. Returns zero in case of success, %-EAGAIN if commit is required, and a negative error codes in case of failure.
int ubifs_consolidate_log | ( | struct ubifs_info * | c | ) |
ubifs_consolidate_log - consolidate the log. : UBIFS file-system description object
Repeated failed commits could cause the log to be full, but at least 1 LEB is needed for commit. This function rewrites the reference nodes in the log omitting duplicates, and failed CS nodes, and leaving no gaps.
This function returns %0 on success and a negative error code on failure.
|
read |
int ubifs_log_end_commit | ( | struct ubifs_info * | c, |
int | ltail_lnum | ||
) |
ubifs_log_end_commit - end commit. : UBIFS file-system description object : new log tail LEB number
This function is called on when the commit operation was finished. It moves log tail to new position and unmaps LEBs which contain obsolete data. Returns zero in case of success and a negative error code in case of failure.
int ubifs_log_post_commit | ( | struct ubifs_info * | c, |
int | old_ltail_lnum | ||
) |
ubifs_log_post_commit - things to do after commit is completed. : UBIFS file-system description object : old log tail LEB number
Release buds only after commit is completed, because they must be unchanged if recovery is needed.
Unmap log LEBs only after commit is completed, because they may be needed for recovery.
This function returns %0 on success and a negative error code on failure.
int ubifs_log_start_commit | ( | struct ubifs_info * | c, |
int * | ltail_lnum | ||
) |
ubifs_log_start_commit - start commit. : UBIFS file-system description object : return new log tail LEB number
The commit operation starts with writing "commit start" node to the log and reference nodes for all journal heads which will define new journal after the commit has been finished. The commit start and reference nodes are written in one go to the nearest empty log LEB (hence, when commit is finished UBIFS may safely unmap all the previous log LEBs). This function returns zero in case of success and a negative error code in case of failure.
|
read |