ubifs superblock
- 1 superblock node.
- store system data
- superblock node be rewritten only if an automatic resize occurs. (image size < volume size -> resizing)
ubi对LEB的操作是原子操作,以保证数据更新成功。
superblock数据定义在下面这个文件中。
fs/ubifs/ubifs-media.h
这个文件描述了ubifs的格式及相关的数据结构和常量的定义。
所有ubifs on-flash objects都是以节点的形式存放的。
所有节点都是以ubifs node magic number开始,并具有相同的的header。
Nodes是8-byte aligned. Node header sizes也是8-byte aligned,(除了indexing node与padding node)。
在看superblock前,记住下面的结构。
/* UBIFS node magic number (must not have the padding byte first or last) */
#define UBIFS_NODE_MAGIC 0x06101831
/**
* struct ubifs_ch - common header node.
* 每个ubifs node都是以common part开始的,如果有key,那么key会紧随common header
*/
struct ubifs_ch {
<