X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_packedtags2.c;h=f8030c7bea0ac89cf453d07e28924b430636945f;hp=e0c55862d04597b26462aaadeda75a4b9387c384;hb=e33554a67753729f6b74677473cf0ec3b8d35a7e;hpb=1ffa02489a63129109b66774681c94fe0a8a946a diff --git a/yaffs_packedtags2.c b/yaffs_packedtags2.c index e0c5586..f8030c7 100644 --- a/yaffs_packedtags2.c +++ b/yaffs_packedtags2.c @@ -1,7 +1,7 @@ /* * YAFFS: Yet Another Flash File System. A NAND-flash specific file system. * - * Copyright (C) 2002-2007 Aleph One Ltd. + * Copyright (C) 2002-2010 Aleph One Ltd. * for Toby Churchill Ltd and Brightstar Engineering * * Created by Charles Manning @@ -13,6 +13,7 @@ #include "yaffs_packedtags2.h" #include "yportenv.h" +#include "yaffs_trace.h" #include "yaffs_tagsvalidity.h" /* This code packs a set of extended tags into a binary structure for @@ -96,24 +97,24 @@ void yaffs_PackTags2TagsPart(yaffs_PackedTags2TagsPart *ptt, } -void yaffs_PackTags2(yaffs_Device *dev, yaffs_PackedTags2 *pt, const yaffs_ExtendedTags *t) +void yaffs_PackTags2(yaffs_PackedTags2 *pt, const yaffs_ExtendedTags *t, int tagsECC) { yaffs_PackTags2TagsPart(&pt->t, t); - if(!dev->noTagsECC) - yaffs_ECCCalculateOther((unsigned char *)&pt->t, + if(tagsECC) + yaffs_ecc_calc_other((unsigned char *)&pt->t, sizeof(yaffs_PackedTags2TagsPart), &pt->ecc); } -void yaffs_UnpackTags2TagsPart(yaffs_ExtendedTags *t, +void yaffs_unpack_tags2tags_part(yaffs_ExtendedTags *t, yaffs_PackedTags2TagsPart *ptt) { memset(t, 0, sizeof(yaffs_ExtendedTags)); - yaffs_InitialiseTags(t); + yaffs_init_tags(t); if (ptt->sequenceNumber != 0xFFFFFFFF) { t->blockBad = 0; @@ -155,21 +156,21 @@ void yaffs_UnpackTags2TagsPart(yaffs_ExtendedTags *t, } -void yaffs_UnpackTags2(yaffs_Device *dev, yaffs_ExtendedTags *t, yaffs_PackedTags2 *pt) +void yaffs_unpack_tags2(yaffs_ExtendedTags *t, yaffs_PackedTags2 *pt, int tagsECC) { yaffs_ECCResult eccResult = YAFFS_ECC_RESULT_NO_ERROR; if (pt->t.sequenceNumber != 0xFFFFFFFF && - !dev->noTagsECC){ + tagsECC){ /* Chunk is in use and we need to do ECC */ yaffs_ECCOther ecc; int result; - yaffs_ECCCalculateOther((unsigned char *)&pt->t, + yaffs_ecc_calc_other((unsigned char *)&pt->t, sizeof(yaffs_PackedTags2TagsPart), &ecc); - result = yaffs_ECCCorrectOther((unsigned char *)&pt->t, + result = yaffs_ecc_correct_other((unsigned char *)&pt->t, sizeof(yaffs_PackedTags2TagsPart), &pt->ecc, &ecc); switch (result) { @@ -187,7 +188,7 @@ void yaffs_UnpackTags2(yaffs_Device *dev, yaffs_ExtendedTags *t, yaffs_PackedTag } } - yaffs_UnpackTags2TagsPart(t, &pt->t); + yaffs_unpack_tags2tags_part(t, &pt->t); t->eccResult = eccResult;