X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_packedtags2.c;h=97668dc7dc4be19b6a3d8d8e897993585aac249a;hp=f734882e47245fed67187ee72721fb3abe7beeda;hb=37fd9ec3587b5c4d497a7682522a9adfab682e51;hpb=f216bcabdaf791aa93ad2e58c1d747d2d8bd6617 diff --git a/yaffs_packedtags2.c b/yaffs_packedtags2.c index f734882..97668dc 100644 --- a/yaffs_packedtags2.c +++ b/yaffs_packedtags2.c @@ -2,19 +2,33 @@ #include "yportenv.h" +static void yaffs_DumpPackedTags2(const yaffs_PackedTags2 *pt) +{ + T(YAFFS_TRACE_MTD,(TSTR("packed tags obj %d chunk %d byte %d seq %d"TENDSTR),pt->t.objectId,pt->t.chunkId,pt->t.byteCount,pt->t.sequenceNumber)); +} + +static void yaffs_DumpTags2(const yaffs_ExtendedTags *t) +{ + T(YAFFS_TRACE_MTD,(TSTR("ext.tags eccres %d blkbad %d chused %d obj %d chunk%d byte %d del %d ser %d seq %d"TENDSTR), + t->eccResult, t->blockBad, t->chunkUsed, t->objectId, t->chunkId, t->byteCount, t->chunkDeleted, t->serialNumber, t->sequenceNumber)); + +} -void yaffs_PackTags2(yaffs_PackedTags2 *pt, yaffs_ExtendedTags *t) +void yaffs_PackTags2(yaffs_PackedTags2 *pt, const yaffs_ExtendedTags *t) { pt->t.chunkId = t->chunkId; pt->t.sequenceNumber = t->sequenceNumber; pt->t.byteCount = t->byteCount; pt->t.objectId = t->objectId; + yaffs_DumpPackedTags2(pt); + yaffs_DumpTags2(t); + yaffs_ECCCalculateOther((unsigned char *)&pt->t,sizeof(yaffs_PackedTags2TagsPart),&pt->ecc); } -void yaffs_UnpackTags2(yaffs_ExtendedTags *t, yaffs_PackedTags2 *pt) +void yaffs_UnpackTags2(yaffs_ExtendedTags *t, const yaffs_PackedTags2 *pt) { @@ -38,5 +52,9 @@ void yaffs_UnpackTags2(yaffs_ExtendedTags *t, yaffs_PackedTags2 *pt) t->serialNumber = 0; t->sequenceNumber = pt->t.sequenceNumber; } + + yaffs_DumpPackedTags2(pt); + yaffs_DumpTags2(t); + }