struct jffs2_sum_unknown_mem { union jffs2_sum_mem *next; /* pointer to the next node */ jint16_t nodetype; /* node type */ }; size = 8 bytesIt is a common header for summary node storage in the memory.
struct jffs2_sum_inode_mem { union jffs2_sum_mem *next; /* pointer to the next node */ jint16_t nodetype; /* == JFFS2_NODETYPE_INODE */ jint32_t inode; /* inode number */ jint32_t version; /* inode version */ jint32_t offset; /* offset on jeb */ jint32_t totlen; /* record length */ }; size = 22 bytesThe difference between the flash and the memory version of jffs2_sum_inode is that the memory version is larger by a pointer.
struct jffs2_sum_dirent_mem { union jffs2_sum_mem *next; /* pointer to the next node */ jint16_t nodetype; /* == JFFS_NODETYPE_DIRENT */ jint32_t totlen; /* record length */ jint32_t offset; /* ofset on jeb */ jint32_t pino; /* parent inode */ jint32_t version; /* dirent version */ jint32_t ino; /* == zero for unlink */ uint8_t nsize; /* dirent name size */ uint8_t type; /* dirent type */ uint8_t name[0]; /* dirent name */ }; size = 28 + name length + 1 bytesThe difference between the flash and the memory version of jffs2_sum_dirent is that the memory version is larger with a pointer.
union jffs2_sum_mem { struct jffs2_sum_unknown_mem u; struct jffs2_sum_inode_mem i; struct jffs2_sum_dirent_mem d; }; size = 28 bytesFor every not closed (not full) eraseblock EBS stores extra information about the nodes which are in it. This information is stored on a list and this union is designed to determine the type of the node.
struct jffs2_summary { uint32_t sum_size; /* summary data size */ uint32_t sum_num; /* number of summary nodes */ uint32_t sum_padded; /* padded size */ union jffs2_sum_mem *sum_list_head; /* summary nodes list head */ union jffs2_sum_mem *sum_list_tail; /* summary nodes list tail */ jint32_t *sum_buf; /* buffer for writing out summary */ }; size = 24 bytesThe jffs2_sb_info structure is extended by a new member. This new member is a pointer to a jffs2_summary structure. This structure stores the necessary information for EBS. sum_size is the size of the summary information of this eraseblock. sum_num is the number of the currently stored summary info about the nodes of the current eraseblock. sum_padded is the size of the paddings of the current eraseblock. sum_list_head is a pointer which points to the first node of the summary node list and sum_list_tail points to the last node. sum_buf is a temporary buffer to compose the summary node.
Havasi Ferenc 2005-12-22