/* Don't compile this module if we don't have MTD's mtd_oob_ops interface */
#if (MTD_VERSION_CODE > MTD_VERSION(2, 6, 17))
-const char *yaffs_mtdif1_c_version = "$Id: yaffs_mtdif1.c,v 1.9 2009-03-06 17:20:52 wookey Exp $";
+const char *yaffs_mtdif1_c_version = "$Id: yaffs_mtdif1.c,v 1.10 2009-03-09 07:41:10 charles Exp $";
#ifndef CONFIG_YAFFS_9BYTE_TAGS
# define YTAG1_SIZE 8
/* We don't yet have a good place to test for MTD config prerequists.
* Do it here as we are called during the initial scan.
*/
- if (nandmtd1_TestPrerequists(mtd) != YAFFS_OK) {
+ if (nandmtd1_TestPrerequists(mtd) != YAFFS_OK)
return YAFFS_FAIL;
- }
retval = nandmtd1_ReadChunkWithTagsFromNAND(dev, chunkNo, NULL, &etags);
etags.blockBad = (mtd->block_isbad)(mtd, addr);
if (memcmp(allFF, pt, sizeof(yaffs_PackedTags1))) {
t->blockBad = 0;
- if (pt->shouldBeFF != 0xFFFFFFFF) {
+ if (pt->shouldBeFF != 0xFFFFFFFF)
t->blockBad = 1;
- }
t->chunkUsed = 1;
t->objectId = pt->objectId;
t->chunkId = pt->chunkId;
/* We save the parent object in the chunkId */
ptt->chunkId = EXTRA_HEADER_INFO_FLAG
| t->extraParentObjectId;
- if (t->extraIsShrinkHeader) {
+ if (t->extraIsShrinkHeader)
ptt->chunkId |= EXTRA_SHRINK_FLAG;
- }
- if (t->extraShadows) {
+ if (t->extraShadows)
ptt->chunkId |= EXTRA_SHADOWS_FLAG;
- }
ptt->objectId &= ~EXTRA_OBJECT_TYPE_MASK;
ptt->objectId |=
(t->extraObjectType << EXTRA_OBJECT_TYPE_SHIFT);
- if (t->extraObjectType == YAFFS_OBJECT_TYPE_HARDLINK) {
+ if (t->extraObjectType == YAFFS_OBJECT_TYPE_HARDLINK)
ptt->byteCount = t->extraEquivalentObjectId;
- } else if (t->extraObjectType == YAFFS_OBJECT_TYPE_FILE) {
+ else if (t->extraObjectType == YAFFS_OBJECT_TYPE_FILE)
ptt->byteCount = t->extraFileLength;
- } else {
+ else
ptt->byteCount = 0;
- }
}
yaffs_DumpPackedTags2TagsPart(ptt);
ptt->objectId >> EXTRA_OBJECT_TYPE_SHIFT;
t->objectId &= ~EXTRA_OBJECT_TYPE_MASK;
- if (t->extraObjectType == YAFFS_OBJECT_TYPE_HARDLINK) {
+ if (t->extraObjectType == YAFFS_OBJECT_TYPE_HARDLINK)
t->extraEquivalentObjectId = ptt->byteCount;
- } else {
+ else
t->extraFileLength = ptt->byteCount;
- }
}
}
yaffs_SpareInitialise(&spare);
- if (eTags->chunkDeleted) {
+ if (eTags->chunkDeleted)
spare.pageStatus = 0;
- } else {
+ else {
tags.objectId = eTags->objectId;
tags.chunkId = eTags->chunkId;
tags.byteCountLSB = eTags->byteCount & 0x3ff;
- if (dev->nDataBytesPerChunk >= 1024) {
+ if (dev->nDataBytesPerChunk >= 1024)
tags.byteCountMSB = (eTags->byteCount >> 10) & 3;
- } else {
+ else
tags.byteCountMSB = 3;
- }
tags.serialNumber = eTags->serialNumber;
- if (!dev->useNANDECC && data) {
+ if (!dev->useNANDECC && data)
yaffs_CalcECC(data, &spare);
- }
+
yaffs_LoadTagsIntoSpare(&spare, &tags);
}