X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=fs%2Fjffs2%2Fjffs2_private.h;h=46ed644e4d4a6dd795ae70a639484447f660751c;hb=c148f24c15743a02e855636e6bed013bd121f7f2;hp=c6d5fe360325307f5754838630f9a643671681ef;hpb=06d01dbe000057e5df4af0f113242f0eba716340;p=u-boot diff --git a/fs/jffs2/jffs2_private.h b/fs/jffs2/jffs2_private.h index c6d5fe3603..46ed644e4d 100644 --- a/fs/jffs2/jffs2_private.h +++ b/fs/jffs2/jffs2_private.h @@ -22,7 +22,6 @@ struct b_list { }; struct b_lists { - char *partOffset; struct b_list dir; struct b_list frag; @@ -42,48 +41,60 @@ static inline int hdr_crc(struct jffs2_unknown_node *node) { #if 1 - u32 crc = crc32_no_comp(0, (unsigned char *)node, sizeof(struct jffs2_unknown_node) - 4); + u32 crc = crc32_no_comp(0, (unsigned char *)node, sizeof(struct jffs2_unknown_node) - 4); #else /* what's the semantics of this? why is this here? */ - u32 crc = crc32_no_comp(~0, (unsigned char *)node, sizeof(struct jffs2_unknown_node) - 4); + u32 crc = crc32_no_comp(~0, (unsigned char *)node, sizeof(struct jffs2_unknown_node) - 4); - crc ^= ~0; + crc ^= ~0; #endif - if (node->hdr_crc != crc) { - return 0; - } else { - return 1; - } + if (node->hdr_crc != crc) { + return 0; + } else { + return 1; + } } static inline int dirent_crc(struct jffs2_raw_dirent *node) { - if (node->node_crc != crc32_no_comp(0, (unsigned char *)node, sizeof(struct jffs2_raw_dirent) - 8)) { - return 0; - } else { - return 1; - } + if (node->node_crc != crc32_no_comp(0, (unsigned char *)node, sizeof(struct jffs2_raw_dirent) - 8)) { + return 0; + } else { + return 1; + } } static inline int dirent_name_crc(struct jffs2_raw_dirent *node) { - if (node->name_crc != crc32_no_comp(0, (unsigned char *)&(node->name), node->nsize)) { - return 0; - } else { - return 1; - } + if (node->name_crc != crc32_no_comp(0, (unsigned char *)&(node->name), node->nsize)) { + return 0; + } else { + return 1; + } } static inline int inode_crc(struct jffs2_raw_inode *node) { - if (node->node_crc != crc32_no_comp(0, (unsigned char *)node, sizeof(struct jffs2_raw_inode) - 8)) { - return 0; - } else { - return 1; - } + if (node->node_crc != crc32_no_comp(0, (unsigned char *)node, sizeof(struct jffs2_raw_inode) - 8)) { + return 0; + } else { + return 1; + } +} + +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 */