]>
git.ipfire.org Git - thirdparty/u-boot.git/blob - fs/jffs2/jffs2_private.h
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
;
13 u32 ino
; /* for inodes */
14 u32 pino
; /* for dirents */
19 struct b_node
*listTail
;
20 struct b_node
*listHead
;
21 #ifdef CONFIG_SYS_JFFS2_SORT_FRAGMENTS
22 struct b_node
*listLast
;
23 int (*listCompare
)(struct b_node
*new, struct b_node
*node
);
27 struct mem_block
*listMemBase
;
43 struct b_compr_info compr_info
[JFFS2_NUM_COMPR
];
47 hdr_crc(struct jffs2_unknown_node
*node
)
50 u32 crc
= crc32_no_comp(0, (unsigned char *)node
, sizeof(struct jffs2_unknown_node
) - 4);
52 /* what's the semantics of this? why is this here? */
53 u32 crc
= crc32_no_comp(~0, (unsigned char *)node
, sizeof(struct jffs2_unknown_node
) - 4);
57 if (node
->hdr_crc
!= crc
) {
65 dirent_crc(struct jffs2_raw_dirent
*node
)
67 if (node
->node_crc
!= crc32_no_comp(0, (unsigned char *)node
, sizeof(struct jffs2_raw_dirent
) - 8)) {
75 dirent_name_crc(struct jffs2_raw_dirent
*node
)
77 if (node
->name_crc
!= crc32_no_comp(0, (unsigned char *)&(node
->name
), node
->nsize
)) {
85 inode_crc(struct jffs2_raw_inode
*node
)
87 if (node
->node_crc
!= crc32_no_comp(0, (unsigned char *)node
, sizeof(struct jffs2_raw_inode
) - 8)) {
95 data_crc(struct jffs2_raw_inode
*node
)
97 if (node
->data_crc
!= crc32_no_comp(0, (unsigned char *)
98 ((int) &node
->node_crc
+ sizeof (node
->node_crc
)),
106 #if defined(CONFIG_SYS_JFFS2_SORT_FRAGMENTS)
107 /* External merge sort. */
108 int sort_list(struct b_list
*list
);
110 #endif /* jffs2_private.h */