]> git.sur5r.net Git - u-boot/blobdiff - fs/jffs2/jffs2_private.h
Merge branch 'master' of git://git.denx.de/u-boot-net
[u-boot] / fs / jffs2 / jffs2_private.h
index 65ca6eb98f239ab26599ac2a6423b6a04c48d145..658b32521904c98eb0460f9760495402fd4a345d 100644 (file)
@@ -7,12 +7,13 @@
 struct b_node {
        u32 offset;
        struct b_node *next;
+       enum { CRC_UNKNOWN = 0, CRC_OK, CRC_BAD } datacrc;
 };
 
 struct b_list {
        struct b_node *listTail;
        struct b_node *listHead;
-#ifdef CFG_JFFS2_SORT_FRAGMENTS
+#ifdef CONFIG_SYS_JFFS2_SORT_FRAGMENTS
        struct b_node *listLast;
        int (*listCompare)(struct b_node *new, struct b_node *node);
        u32 listLoops;
@@ -24,7 +25,7 @@ struct b_list {
 struct b_lists {
        struct b_list dir;
        struct b_list frag;
-
+       void *readbuf;
 };
 
 struct b_compr_info {
@@ -85,4 +86,16 @@ inode_crc(struct jffs2_raw_inode *node)
        }
 }
 
+static inline int
+data_crc(struct jffs2_raw_inode *node)
+{
+       if (node->data_crc != crc32_no_comp(0, (unsigned char *)
+                                           ((int) &node->node_crc + sizeof (node->node_crc)),
+                                            node->csize)) {
+               return 0;
+       } else {
+               return 1;
+       }
+}
+
 #endif /* jffs2_private.h */