struct jffs2_cent_sum_log_node { jint16_t magic; /* A constant magic number. */ jint16_t nodetype; /* = JFFS2_NODETYPE_CENT_SUM_LOG */ jint32_t totlen; /* Total length of this node (inc data, etc.) */ jint32_t hdr_crc; /* CRC checksum */ uint8_t valid; /* 0 = mount log, 1 = umount log*/ jint32_t erase_size; /* erase block size */ jint16_t ofs_num; /* number of jeb offsets */ jint32_t ofs_crc; /* ofs CRC */ jint32_t node_crc; /* node CRC */ jint32_t ofs[0]; /* offsets, where centralized summary information is */ }; size = 27 bytesThis node is stored in the CS block. valid field is a flag. If it is 0 then it means this log is an unmount log otherwise it is a mount log. If the mount process finds jffs2_cent_sum_log_node in the first not bad block then it searches for the last node in it. If the last node is umount log then it means the umount was not clean otherwise the umount was clean and the locations of CS nodes are listed in the ofs array. erase_size is the size of the eraseblock where this image was created. ofs_num is the number of the CS node offsets.
struct cent_sum_inocache { jint32_t ino; jint32_t nlink; jint32_t state; }; size = 12 bytesino is an inode number to which this inode cache information belongs. nlink is the inode cache nlink number. state shows the inode cache state. state can get on two different values: if the inode cache state is INO_STATE_UNCHECKED at the moment of the unmount then we store INO_STATE_UNCHECKED otherwise INO_STATE_CHECKEDABSENT.
struct jffs2_cent_sum_inocache_node { jint16_t magic; /* A constant magic number. */ jint16_t nodetype; /* = JFFS2_NODETYPE_CENT_SUM_INOCACHE */ jint32_t totlen; /* Total length of this node (inc data, etc.) */ jint32_t hdr_crc; /* CRC checksum */ jint32_t cache_num; /* number of cache entries */ jint32_t cache_crc; /* cache information CRC */ jint32_t node_crc; /* node CRC */ jint32_t cache[0]; /* cache info */ }; size = 24 bytesThis kind of node stores all the information that CS mount process needs to set back the inode cache to the original state. cache stores cent_sum_inocache structures.
struct cent_sum_jeb { jint32_t offset; jint32_t unchecked_size; jint32_t used_size; jint32_t dirty_size; jint32_t wasted_size; }; size = 20 bytesThis structure describes the state of a jeb in the view of allocated space. offset shows the offset of the jeb to which this information corresponds. The variables refers to the same variables of the jeb.
struct jffs2_cent_sum_jebinfo_node { jint16_t magic; /* A constant magic number. */ jint16_t nodetype; /* = JFFS2_NODETYPE_CENT_SUM_JEBINFO */ jint32_t totlen; /* Total length of this node (inc data, etc.) */ jint32_t hdr_crc; /* CRC checksum */ jint32_t jebinfo_num; /* number of jeb entries */ jint32_t jebinfo_crc; /* jeb CRC */ jint32_t node_crc; /* node CRC */ jint32_t jebinfo[0]; /* jeb info */ }; size = 24 bytesThis node stores space information about all the jebs. With these we can calculate jeb and sb space counters.
struct cent_sum_rawref { jint32_t flash_offset; jint32_t totlen; jint32_t ino; }; size = 12 bytesCS uses a small structure to save the relevant part of every jffs2_raw_node_ref. flash_offset is the offset of the node to which the jffs2_raw_node_ref belongs. totlen is the length of the node. ino is the number of the inode to which it belongs.
struct jffs2_cent_sum_rawref_node { jint16_t magic; /* A constant magic number. */ jint16_t nodetype; /* = JFFS2_NODETYPE_CENT_SUM_RAWREF */ jint32_t totlen; /* Total length of this node (inc data, etc.) */ jint32_t hdr_crc; /* Crc checksum */ jint32_t rawref_num; /* number of jeb entries */ jint32_t rawref_crc; /* rawrefs crc */ jint32_t node_crc; /* node crc */ jint32_t rawrefs[0]; /* rawref info */ }; size = 24 bytesThis node stores information all of the jffs2_raw_node_refs in an array of cent_sum_rawref structures. That's why this is the largest part of the CS data stored on flash.
struct jffs2_cent_sum_lists_node { jint16_t magic; /* A constant magic number. */ jint16_t nodetype; /* = JFFS2_NODETYPE_CENT_SUM_LISTS */ jint32_t totlen; /* Total length of this node (inc data, etc.) */ jint32_t hdr_crc; /* CRC checksum */ jint32_t lists_crc; /* lists CRC */ jint16_t lists[0]; /* list info */ }; size = 16 bytesjffs2_cent_sum_lists_node stores information about JFFS2 jeb lists. JFFS2 has 7 different list. We must store these lists on flash that we can put every jeb to the correct list after mount. Every list is stored in the same way: first write out the number of the elements of the list and then write out the elements one after the other. number is stored on 2 bytes and the elements too. The sequence of the lists are fixed (see the sequence in jffs2_sb_info).
Havasi Ferenc 2005-12-22