Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions
lpt.c File Reference
#include "ubifs.h"
#include <linux/crc16.h>
#include <linux/math64.h>
#include <linux/slab.h>

Go to the source code of this file.

Data Structures

struct  lpt_scan_node
 

Functions

int ubifs_calc_lpt_geom (struct ubifs_info *c)
 
uint32_t ubifs_unpack_bits (uint8_t **addr, int *pos, int nrbits)
 
void ubifs_pack_pnode (struct ubifs_info *c, void *buf, struct ubifs_pnode *pnode)
 
void ubifs_pack_nnode (struct ubifs_info *c, void *buf, struct ubifs_nnode *nnode)
 
void ubifs_pack_ltab (struct ubifs_info *c, void *buf, struct ubifs_lpt_lprops *ltab)
 
void ubifs_pack_lsave (struct ubifs_info *c, void *buf, int *lsave)
 
void ubifs_add_lpt_dirt (struct ubifs_info *c, int lnum, int dirty)
 
void ubifs_add_nnode_dirt (struct ubifs_info *c, struct ubifs_nnode *nnode)
 
int ubifs_create_dflt_lpt (struct ubifs_info *c, int *main_lebs, int lpt_first, int *lpt_lebs, int *big_lpt)
 
int ubifs_unpack_nnode (const struct ubifs_info *c, void *buf, struct ubifs_nnode *nnode)
 
int ubifs_read_nnode (struct ubifs_info *c, struct ubifs_nnode *parent, int iip)
 
struct ubifs_nnodeubifs_get_nnode (struct ubifs_info *c, struct ubifs_nnode *parent, int iip)
 
struct ubifs_pnodeubifs_get_pnode (struct ubifs_info *c, struct ubifs_nnode *parent, int iip)
 
struct ubifs_lpropsubifs_lpt_lookup (struct ubifs_info *c, int lnum)
 
struct ubifs_lpropsubifs_lpt_lookup_dirty (struct ubifs_info *c, int lnum)
 
int ubifs_lpt_init (struct ubifs_info *c, int rd, int wr)
 
int ubifs_lpt_scan_nolock (struct ubifs_info *c, int start_lnum, int end_lnum, ubifs_lpt_scan_callback scan_cb, void *data)
 
int dbg_check_lpt_nodes (struct ubifs_info *c, struct ubifs_cnode *cnode, int row, int col)
 

Function Documentation

int dbg_check_lpt_nodes ( struct ubifs_info c,
struct ubifs_cnode cnode,
int  row,
int  col 
)

dbg_check_lpt_nodes - check nnodes and pnodes. : the UBIFS file-system description object : next cnode (nnode or pnode) to check : row of cnode (root is zero) : column of cnode (leftmost is zero)

This function returns %0 on success and a negative error code on failure.

Definition at line 2223 of file lpt.c.

void ubifs_add_lpt_dirt ( struct ubifs_info c,
int  lnum,
int  dirty 
)

ubifs_add_lpt_dirt - add dirty space to LPT LEB properties. : UBIFS file-system description object : LEB number to which to add dirty space : amount of dirty space to add

Definition at line 462 of file lpt.c.

void ubifs_add_nnode_dirt ( struct ubifs_info c,
struct ubifs_nnode nnode 
)

ubifs_add_nnode_dirt - add dirty space to LPT LEB properties. : UBIFS file-system description object : nnode for which to add dirt

Definition at line 494 of file lpt.c.

int ubifs_calc_lpt_geom ( struct ubifs_info c)

ubifs_calc_lpt_geom - calculate and check sizes for the LPT area. : the UBIFS file-system description object

This function returns %0 on success and a negative error code on failure.

Definition at line 137 of file lpt.c.

int ubifs_create_dflt_lpt ( struct ubifs_info c,
int main_lebs,
int  lpt_first,
int lpt_lebs,
int big_lpt 
)

ubifs_create_dflt_lpt - create default LPT. : UBIFS file-system description object : number of main area LEBs is passed and returned here : LEB number of first LPT LEB : number of LEBs for LPT is passed and returned here : use big LPT model is passed and returned here

This function returns %0 on success and a negative error code on failure.

Definition at line 608 of file lpt.c.

struct ubifs_nnode* ubifs_get_nnode ( struct ubifs_info c,
struct ubifs_nnode parent,
int  iip 
)
read

ubifs_get_nnode - get a nnode. : UBIFS file-system description object : parent nnode (or NULL for the root) : index in parent

This function returns a pointer to the nnode on success or a negative error code on failure.

Definition at line 1393 of file lpt.c.

struct ubifs_pnode* ubifs_get_pnode ( struct ubifs_info c,
struct ubifs_nnode parent,
int  iip 
)
read

ubifs_get_pnode - get a pnode. : UBIFS file-system description object : parent nnode : index in parent

This function returns a pointer to the pnode on success or a negative error code on failure.

Definition at line 1419 of file lpt.c.

int ubifs_lpt_init ( struct ubifs_info c,
int  rd,
int  wr 
)

ubifs_lpt_init - initialize the LPT. : UBIFS file-system description object : whether to initialize lpt for reading : whether to initialize lpt for writing

For mounting 'rw', and are both true. For mounting 'ro', is true and is false. For mounting from 'ro' to 'rw', is false and is true.

This function returns %0 on success and a negative error code on failure.

Definition at line 1733 of file lpt.c.

struct ubifs_lprops* ubifs_lpt_lookup ( struct ubifs_info c,
int  lnum 
)
read

ubifs_lpt_lookup - lookup LEB properties in the LPT. : UBIFS file-system description object : LEB number to lookup

This function returns a pointer to the LEB properties on success or a negative error code on failure.

Definition at line 1445 of file lpt.c.

struct ubifs_lprops* ubifs_lpt_lookup_dirty ( struct ubifs_info c,
int  lnum 
)
read

ubifs_lpt_lookup_dirty - lookup LEB properties in the LPT. : UBIFS file-system description object : LEB number to lookup

This function returns a pointer to the LEB properties on success or a negative error code on failure.

Definition at line 1579 of file lpt.c.

int ubifs_lpt_scan_nolock ( struct ubifs_info c,
int  start_lnum,
int  end_lnum,
ubifs_lpt_scan_callback  scan_cb,
void data 
)

ubifs_lpt_scan_nolock - scan the LPT. : the UBIFS file-system description object : LEB number from which to start scanning : LEB number at which to stop scanning : callback function called for each lprops : data to be passed to the callback function

This function returns %0 on success and a negative error code on failure.

Definition at line 1922 of file lpt.c.

void ubifs_pack_lsave ( struct ubifs_info c,
void buf,
int lsave 
)

ubifs_pack_lsave - pack the LPT's save table. : UBIFS file-system description object : buffer into which to pack : LPT's save table to pack

Definition at line 440 of file lpt.c.

void ubifs_pack_ltab ( struct ubifs_info c,
void buf,
struct ubifs_lpt_lprops ltab 
)

ubifs_pack_ltab - pack the LPT's own lprops table. : UBIFS file-system description object : buffer into which to pack : LPT's own lprops table to pack

Definition at line 415 of file lpt.c.

void ubifs_pack_nnode ( struct ubifs_info c,
void buf,
struct ubifs_nnode nnode 
)

ubifs_pack_nnode - pack all the bit fields of a nnode. : UBIFS file-system description object : buffer into which to pack : nnode to pack

Definition at line 383 of file lpt.c.

void ubifs_pack_pnode ( struct ubifs_info c,
void buf,
struct ubifs_pnode pnode 
)

ubifs_pack_pnode - pack all the bit fields of a pnode. : UBIFS file-system description object : buffer into which to pack : pnode to pack

Definition at line 350 of file lpt.c.

int ubifs_read_nnode ( struct ubifs_info c,
struct ubifs_nnode parent,
int  iip 
)

ubifs_read_nnode - read a nnode from flash and link it to the tree in memory. : UBIFS file-system description object : parent nnode (or NULL for the root) : index in parent

This function returns %0 on success and a negative error code on failure.

Definition at line 1192 of file lpt.c.

uint32_t ubifs_unpack_bits ( uint8_t **  addr,
int pos,
int  nrbits 
)

ubifs_unpack_bits - unpack bit fields. : address at which to unpack (passed and next address returned) : bit position at which to unpack (passed and next position returned) : number of bits of value to unpack (1-32)

This functions returns the value unpacked.

Definition at line 283 of file lpt.c.

int ubifs_unpack_nnode ( const struct ubifs_info c,
void buf,
struct ubifs_nnode nnode 
)

ubifs_unpack_nnode - unpack a nnode. : UBIFS file-system description object : buffer containing packed nnode to unpack : nnode structure to fill

This function returns %0 on success and a negative error code on failure.

Definition at line 1000 of file lpt.c.