1 #ifndef jffs2_private_h
2 #define jffs2_private_h
4 #include <jffs2/jffs2.h>
10 enum { CRC_UNKNOWN = 0, CRC_OK, CRC_BAD } datacrc;
14 struct b_node *listTail;
15 struct b_node *listHead;
16 #ifdef CONFIG_SYS_JFFS2_SORT_FRAGMENTS
17 struct b_node *listLast;
18 int (*listCompare)(struct b_node *new, struct b_node *node);
22 struct mem_block *listMemBase;
38 struct b_compr_info compr_info[JFFS2_NUM_COMPR];
42 hdr_crc(struct jffs2_unknown_node *node)
45 u32 crc = crc32_no_comp(0, (unsigned char *)node, sizeof(struct jffs2_unknown_node) - 4);
47 /* what's the semantics of this? why is this here? */
48 u32 crc = crc32_no_comp(~0, (unsigned char *)node, sizeof(struct jffs2_unknown_node) - 4);
52 if (node->hdr_crc != crc) {
60 dirent_crc(struct jffs2_raw_dirent *node)
62 if (node->node_crc != crc32_no_comp(0, (unsigned char *)node, sizeof(struct jffs2_raw_dirent) - 8)) {
70 dirent_name_crc(struct jffs2_raw_dirent *node)
72 if (node->name_crc != crc32_no_comp(0, (unsigned char *)&(node->name), node->nsize)) {
80 inode_crc(struct jffs2_raw_inode *node)
82 if (node->node_crc != crc32_no_comp(0, (unsigned char *)node, sizeof(struct jffs2_raw_inode) - 8)) {
90 data_crc(struct jffs2_raw_inode *node)
92 if (node->data_crc != crc32_no_comp(0, (unsigned char *)
93 ((int) &node->node_crc + sizeof (node->node_crc)),
101 #if defined(CONFIG_SYS_JFFS2_SORT_FRAGMENTS)
102 /* External merge sort. */
103 int sort_list(struct b_list *list);
105 #endif /* jffs2_private.h */