Пример #1
0
int yaffs_TagsCompatabilityWriteChunkWithTagsToNAND(yaffs_Device * dev,
        int chunkInNAND,
        const __u8 * data,
        const yaffs_ExtendedTags *
        eTags)
{
    yaffs_Spare spare;
    yaffs_Tags tags;

    yaffs_SpareInitialise(&spare);

    if (eTags->chunkDeleted) {
        spare.pageStatus = 0;
    } else {
        tags.objectId = eTags->objectId;
        tags.chunkId = eTags->chunkId;
        tags.byteCount = eTags->byteCount;
        tags.serialNumber = eTags->serialNumber;

        if (!dev->useNANDECC && data) {
            yaffs_CalcECC(data, &spare);
        }
        yaffs_LoadTagsIntoSpare(&spare, &tags);

    }

    return yaffs_WriteChunkToNAND(dev, chunkInNAND, data, &spare);
}
Пример #2
0
int yaffs_TagsCompatabilityWriteChunkWithTagsToNAND(yaffs_Device *dev,
						int chunkInNAND,
						const __u8 *data,
						const yaffs_ExtendedTags *eTags)
{
	yaffs_Spare spare;
	yaffs_Tags tags;

	yaffs_SpareInitialise(&spare);

	if (eTags->chunkDeleted)
		spare.pageStatus = 0;
	else {
		tags.objectId = eTags->objectId;
		tags.chunkId = eTags->chunkId;

		tags.byteCountLSB = eTags->byteCount & 0x3ff;

		if (dev->nDataBytesPerChunk >= 1024)
			tags.byteCountMSB = (eTags->byteCount >> 10) & 3;
		else
			tags.byteCountMSB = 3;


		tags.serialNumber = eTags->serialNumber;

		if (!dev->useNANDECC && data)
			yaffs_CalcECC(data, &spare);

		yaffs_LoadTagsIntoSpare(&spare, &tags);

	}