/* Debugging switches */
#undef DEBUG_DIRENTS /* print directory entry list after scan */
#undef DEBUG_FRAGMENTS /* print fragment list after scan */
/* Debugging switches */
#undef DEBUG_DIRENTS /* print directory entry list after scan */
#undef DEBUG_FRAGMENTS /* print fragment list after scan */
/* Sort data entries with the latest version last, so that if there
* is overlapping data the latest version will be used.
*/
/* Sort data entries with the latest version last, so that if there
* is overlapping data the latest version will be used.
*/
pL = (struct b_lists *)part->jffs2_priv;
memset(pL, 0, sizeof(*pL));
pL = (struct b_lists *)part->jffs2_priv;
memset(pL, 0, sizeof(*pL));
/* Find file size before loading any data, so fragments that
* start past the end of file can be ignored. A fragment
* that is partially in the file is loaded, so extra data may
/* Find file size before loading any data, so fragments that
* start past the end of file can be ignored. A fragment
* that is partially in the file is loaded, so extra data may
/* get actual file length from the newest node */
if (jNode->version >= latestVersion) {
totalSize = jNode->isize;
/* get actual file length from the newest node */
if (jNode->version >= latestVersion) {
totalSize = jNode->isize;
case JFFS2_COMPR_ZLIB:
ret = zlib_decompress(src, dst, inode->csize, inode->dsize);
break;
case JFFS2_COMPR_ZLIB:
ret = zlib_decompress(src, dst, inode->csize, inode->dsize);
break;
case JFFS2_COMPR_LZO:
ret = lzo_decompress(src, dst, inode->csize, inode->dsize);
break;
case JFFS2_COMPR_LZO:
ret = lzo_decompress(src, dst, inode->csize, inode->dsize);
break;
-// putnstr(jDir->name, jDir->nsize);
-// putLabeledWord(" has dup version =", version);
+/* putnstr(jDir->name, jDir->nsize); */
+/* putLabeledWord(" has dup version =", version); */
/* we need to search all and return the inode with the highest version */
for (jDir = (struct b_dirent *)pL->dir.listHead; jDir; jDir = jDir->next) {
if (ino == jDir->ino) {
/* we need to search all and return the inode with the highest version */
for (jDir = (struct b_dirent *)pL->dir.listHead; jDir; jDir = jDir->next) {
if (ino == jDir->ino) {
-// putnstr(jDir->name, jDir->nsize);
-// putLabeledWord(" has dup version (resolve) = ",
-// version);
+/* putnstr(jDir->name, jDir->nsize); */
+/* putLabeledWord(" has dup version (resolve) = ", */
+/* version); */
-#if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND)
- if (nanddev != (int)part->usr_priv - 1) {
- DEBUGF ("rescan: nand device changed\n");
- return -1;
- }
-#endif /* defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND) */
putLabeledWord("\tbuild_list: type = ", jDir->type);
putLabeledWord("\tbuild_list: node_crc = ", jDir->node_crc);
putLabeledWord("\tbuild_list: name_crc = ", jDir->name_crc);
putLabeledWord("\tbuild_list: type = ", jDir->type);
putLabeledWord("\tbuild_list: node_crc = ", jDir->node_crc);
putLabeledWord("\tbuild_list: name_crc = ", jDir->name_crc);
-#if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND)
- nanddev = (int)part->usr_priv - 1;
- nand = &nand_info[nanddev];
-#endif /* defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND) */
+ struct mtdids *id = part->dev->id;
+ nand = nand_info + id->num;
} else if (node->nodetype == JFFS2_NODETYPE_CLEANMARKER) {
if (node->totlen != sizeof(struct jffs2_unknown_node))
printf("OOPS Cleanmarker has bad size "
} else if (node->nodetype == JFFS2_NODETYPE_CLEANMARKER) {
if (node->totlen != sizeof(struct jffs2_unknown_node))
printf("OOPS Cleanmarker has bad size "
sizeof(struct jffs2_unknown_node));
} else if (node->nodetype == JFFS2_NODETYPE_PADDING) {
if (node->totlen < sizeof(struct jffs2_unknown_node))
printf("OOPS Padding has bad size "
sizeof(struct jffs2_unknown_node));
} else if (node->nodetype == JFFS2_NODETYPE_PADDING) {
if (node->totlen < sizeof(struct jffs2_unknown_node))
printf("OOPS Padding has bad size "
- printf("Unknown node type: %x len %d "
- "offset 0x%x\n", node->nodetype,
+ printf("Unknown node type: %x len %d offset 0x%x\n",
+ node->nodetype,