Go to the documentation of this file.
33 #ifndef __UBIFS_MEDIA_H__
34 #define __UBIFS_MEDIA_H__
37 #define UBIFS_NODE_MAGIC 0x06101831
49 #define UBIFS_FORMAT_VERSION 4
62 #define UBIFS_RO_COMPAT_VERSION 0
65 #define UBIFS_MIN_LEB_SZ (15*1024)
68 #define UBIFS_CRC32_INIT 0xFFFFFFFFU
74 #define UBIFS_MIN_COMPR_LEN 128
81 #define UBIFS_MIN_COMPRESS_DIFF 64
84 #define UBIFS_ROOT_INO 1
87 #define UBIFS_FIRST_INO 64
93 #define UBIFS_MAX_NLEN 255
96 #define UBIFS_MAX_JHEADS 1
105 #define UBIFS_BLOCK_SIZE 4096
106 #define UBIFS_BLOCK_SHIFT 12
109 #define UBIFS_PADDING_BYTE 0xCE
112 #define UBIFS_MAX_KEY_LEN 16
115 #define UBIFS_SK_LEN 8
118 #define UBIFS_MIN_FANOUT 3
121 #define UBIFS_MAX_LEVELS 512
124 #define UBIFS_MAX_INO_DATA UBIFS_BLOCK_SIZE
127 #define UBIFS_LPT_FANOUT 4
128 #define UBIFS_LPT_FANOUT_SHIFT 2
131 #define UBIFS_LPT_CRC_BITS 16
132 #define UBIFS_LPT_CRC_BYTES 2
133 #define UBIFS_LPT_TYPE_BITS 4
136 #define UBIFS_KEY_OFFSET offsetof(struct ubifs_ino_node, key)
139 #define UBIFS_GC_HEAD 0
141 #define UBIFS_BASE_HEAD 1
143 #define UBIFS_DATA_HEAD 2
211 #define UBIFS_S_KEY_BLOCK_BITS 29
212 #define UBIFS_S_KEY_BLOCK_MASK 0x1FFFFFFF
213 #define UBIFS_S_KEY_HASH_BITS UBIFS_S_KEY_BLOCK_BITS
214 #define UBIFS_S_KEY_HASH_MASK UBIFS_S_KEY_BLOCK_MASK
234 #define UBIFS_SB_LEBS 1
236 #define UBIFS_MST_LEBS 2
239 #define UBIFS_SB_LNUM 0
241 #define UBIFS_MST_LNUM (UBIFS_SB_LNUM + UBIFS_SB_LEBS)
243 #define UBIFS_LOG_LNUM (UBIFS_MST_LNUM + UBIFS_MST_LEBS)
256 #define UBIFS_MIN_LOG_LEBS 2
258 #define UBIFS_MIN_BUD_LEBS 3
260 #define UBIFS_MIN_JNL_LEBS (UBIFS_MIN_LOG_LEBS + UBIFS_MIN_BUD_LEBS)
262 #define UBIFS_MIN_LPT_LEBS 2
264 #define UBIFS_MIN_ORPH_LEBS 1
269 #define UBIFS_MIN_MAIN_LEBS (UBIFS_MIN_BUD_LEBS + 6)
272 #define UBIFS_MIN_LEB_CNT (UBIFS_SB_LEBS + UBIFS_MST_LEBS + \
273 UBIFS_MIN_LOG_LEBS + UBIFS_MIN_LPT_LEBS + \
274 UBIFS_MIN_ORPH_LEBS + UBIFS_MIN_MAIN_LEBS)
277 #define UBIFS_CH_SZ sizeof(struct ubifs_ch)
278 #define UBIFS_INO_NODE_SZ sizeof(struct ubifs_ino_node)
279 #define UBIFS_DATA_NODE_SZ sizeof(struct ubifs_data_node)
280 #define UBIFS_DENT_NODE_SZ sizeof(struct ubifs_dent_node)
281 #define UBIFS_TRUN_NODE_SZ sizeof(struct ubifs_trun_node)
282 #define UBIFS_PAD_NODE_SZ sizeof(struct ubifs_pad_node)
283 #define UBIFS_SB_NODE_SZ sizeof(struct ubifs_sb_node)
284 #define UBIFS_MST_NODE_SZ sizeof(struct ubifs_mst_node)
285 #define UBIFS_REF_NODE_SZ sizeof(struct ubifs_ref_node)
286 #define UBIFS_IDX_NODE_SZ sizeof(struct ubifs_idx_node)
287 #define UBIFS_CS_NODE_SZ sizeof(struct ubifs_cs_node)
288 #define UBIFS_ORPH_NODE_SZ sizeof(struct ubifs_orph_node)
290 #define UBIFS_XENT_NODE_SZ UBIFS_DENT_NODE_SZ
292 #define UBIFS_BRANCH_SZ sizeof(struct ubifs_branch)
295 #define UBIFS_MAX_DATA_NODE_SZ (UBIFS_DATA_NODE_SZ + UBIFS_BLOCK_SIZE)
296 #define UBIFS_MAX_INO_NODE_SZ (UBIFS_INO_NODE_SZ + UBIFS_MAX_INO_DATA)
297 #define UBIFS_MAX_DENT_NODE_SZ (UBIFS_DENT_NODE_SZ + UBIFS_MAX_NLEN + 1)
298 #define UBIFS_MAX_XENT_NODE_SZ UBIFS_MAX_DENT_NODE_SZ
301 #define UBIFS_MAX_NODE_SZ UBIFS_MAX_INO_NODE_SZ
327 #define UBIFS_FL_MASK 0x0000001F