annotate yaffs_packedtags2.c @ 255:467bb4a77339

Improve handling of ecc on tags
author charles
date Fri, 16 Jan 2009 00:45:47 +0000
parents fad21fd1971d
children c8620405d086
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
1 /*
174
7d11ae6795e4 normalise licence headers and attributions
wookey
parents: 148
diff changeset
2 * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
15
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
3 *
174
7d11ae6795e4 normalise licence headers and attributions
wookey
parents: 148
diff changeset
4 * Copyright (C) 2002-2007 Aleph One Ltd.
7d11ae6795e4 normalise licence headers and attributions
wookey
parents: 148
diff changeset
5 * for Toby Churchill Ltd and Brightstar Engineering
15
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
6 *
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
7 * Created by Charles Manning <charles@aleph1.co.uk>
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
8 *
174
7d11ae6795e4 normalise licence headers and attributions
wookey
parents: 148
diff changeset
9 * This program is free software; you can redistribute it and/or modify
7d11ae6795e4 normalise licence headers and attributions
wookey
parents: 148
diff changeset
10 * it under the terms of the GNU General Public License version 2 as
7d11ae6795e4 normalise licence headers and attributions
wookey
parents: 148
diff changeset
11 * published by the Free Software Foundation.
15
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
12 */
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
13
6
ffe653f3cb4f *** empty log message ***
charles
parents:
diff changeset
14 #include "yaffs_packedtags2.h"
ffe653f3cb4f *** empty log message ***
charles
parents:
diff changeset
15 #include "yportenv.h"
15
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
16 #include "yaffs_tagsvalidity.h"
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
17
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
18 /* This code packs a set of extended tags into a binary structure for
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
19 * NAND storage
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
20 */
15
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
21
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
22 /* Some of the information is "extra" struff which can be packed in to
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
23 * speed scanning
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
24 * This is defined by having the EXTRA_HEADER_INFO_FLAG set.
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
25 */
15
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
26
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
27 /* Extra flags applied to chunkId */
15
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
28
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
29 #define EXTRA_HEADER_INFO_FLAG 0x80000000
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
30 #define EXTRA_SHRINK_FLAG 0x40000000
50
4a79e23a3570 Add flag for object shadowing
charles
parents: 24
diff changeset
31 #define EXTRA_SHADOWS_FLAG 0x20000000
4a79e23a3570 Add flag for object shadowing
charles
parents: 24
diff changeset
32 #define EXTRA_SPARE_FLAGS 0x10000000
15
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
33
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
34 #define ALL_EXTRA_FLAGS 0xF0000000
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
35
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
36 /* Also, the top 4 bits of the object Id are set to the object type. */
15
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
37 #define EXTRA_OBJECT_TYPE_SHIFT (28)
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
38 #define EXTRA_OBJECT_TYPE_MASK ((0x0F) << EXTRA_OBJECT_TYPE_SHIFT)
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
39
211
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
40
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
41 static void yaffs_DumpPackedTags2TagsPart(const yaffs_PackedTags2TagsPart * ptt)
7
ddfefbbf40d3 *** empty log message ***
charles
parents: 6
diff changeset
42 {
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
43 T(YAFFS_TRACE_MTD,
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
44 (TSTR("packed tags obj %d chunk %d byte %d seq %d" TENDSTR),
211
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
45 ptt->objectId, ptt->chunkId, ptt->byteCount,
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
46 ptt->sequenceNumber));
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
47 }
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
48 static void yaffs_DumpPackedTags2(const yaffs_PackedTags2 * pt)
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
49 {
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
50 yaffs_DumpPackedTags2TagsPart(&pt->t);
7
ddfefbbf40d3 *** empty log message ***
charles
parents: 6
diff changeset
51 }
6
ffe653f3cb4f *** empty log message ***
charles
parents:
diff changeset
52
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
53 static void yaffs_DumpTags2(const yaffs_ExtendedTags * t)
7
ddfefbbf40d3 *** empty log message ***
charles
parents: 6
diff changeset
54 {
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
55 T(YAFFS_TRACE_MTD,
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
56 (TSTR
211
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
57 ("ext.tags eccres %d blkbad %d chused %d obj %d chunk%d byte %d del %d ser %d seq %d"
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
58 TENDSTR), t->eccResult, t->blockBad, t->chunkUsed, t->objectId,
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
59 t->chunkId, t->byteCount, t->chunkDeleted, t->serialNumber,
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
60 t->sequenceNumber));
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
61
7
ddfefbbf40d3 *** empty log message ***
charles
parents: 6
diff changeset
62 }
ddfefbbf40d3 *** empty log message ***
charles
parents: 6
diff changeset
63
211
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
64 void yaffs_PackTags2TagsPart(yaffs_PackedTags2TagsPart * ptt, const yaffs_ExtendedTags * t)
6
ffe653f3cb4f *** empty log message ***
charles
parents:
diff changeset
65 {
211
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
66 ptt->chunkId = t->chunkId;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
67 ptt->sequenceNumber = t->sequenceNumber;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
68 ptt->byteCount = t->byteCount;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
69 ptt->objectId = t->objectId;
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
70
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
71 if (t->chunkId == 0 && t->extraHeaderInfoAvailable) {
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
72 /* Store the extra header info instead */
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
73 /* We save the parent object in the chunkId */
211
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
74 ptt->chunkId = EXTRA_HEADER_INFO_FLAG
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
75 | t->extraParentObjectId;
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
76 if (t->extraIsShrinkHeader) {
211
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
77 ptt->chunkId |= EXTRA_SHRINK_FLAG;
15
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
78 }
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
79 if (t->extraShadows) {
211
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
80 ptt->chunkId |= EXTRA_SHADOWS_FLAG;
50
4a79e23a3570 Add flag for object shadowing
charles
parents: 24
diff changeset
81 }
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
82
211
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
83 ptt->objectId &= ~EXTRA_OBJECT_TYPE_MASK;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
84 ptt->objectId |=
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
85 (t->extraObjectType << EXTRA_OBJECT_TYPE_SHIFT);
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
86
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
87 if (t->extraObjectType == YAFFS_OBJECT_TYPE_HARDLINK) {
211
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
88 ptt->byteCount = t->extraEquivalentObjectId;
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
89 } else if (t->extraObjectType == YAFFS_OBJECT_TYPE_FILE) {
211
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
90 ptt->byteCount = t->extraFileLength;
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
91 } else {
211
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
92 ptt->byteCount = 0;
15
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
93 }
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
94 }
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
95
211
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
96 yaffs_DumpPackedTags2TagsPart(ptt);
7
ddfefbbf40d3 *** empty log message ***
charles
parents: 6
diff changeset
97 yaffs_DumpTags2(t);
211
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
98 }
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
99
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
100
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
101 void yaffs_PackTags2(yaffs_PackedTags2 * pt, const yaffs_ExtendedTags * t)
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
102 {
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
103 yaffs_PackTags2TagsPart(&pt->t,t);
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
104
24
4ebabd859f38 Some improvements to garbage collection and st_xxx to yst_xxx changes
charles
parents: 15
diff changeset
105 #ifndef YAFFS_IGNORE_TAGS_ECC
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
106 {
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
107 yaffs_ECCCalculateOther((unsigned char *)&pt->t,
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
108 sizeof(yaffs_PackedTags2TagsPart),
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
109 &pt->ecc);
24
4ebabd859f38 Some improvements to garbage collection and st_xxx to yst_xxx changes
charles
parents: 15
diff changeset
110 }
4ebabd859f38 Some improvements to garbage collection and st_xxx to yst_xxx changes
charles
parents: 15
diff changeset
111 #endif
6
ffe653f3cb4f *** empty log message ***
charles
parents:
diff changeset
112 }
ffe653f3cb4f *** empty log message ***
charles
parents:
diff changeset
113
211
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
114
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
115 void yaffs_UnpackTags2TagsPart(yaffs_ExtendedTags * t, yaffs_PackedTags2TagsPart * ptt)
6
ffe653f3cb4f *** empty log message ***
charles
parents:
diff changeset
116 {
ffe653f3cb4f *** empty log message ***
charles
parents:
diff changeset
117
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
118 memset(t, 0, sizeof(yaffs_ExtendedTags));
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
119
15
25dfba77df6a Add scanning speedups
charles
parents: 7
diff changeset
120 yaffs_InitialiseTags(t);
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
121
211
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
122 if (ptt->sequenceNumber != 0xFFFFFFFF) {
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
123 t->blockBad = 0;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
124 t->chunkUsed = 1;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
125 t->objectId = ptt->objectId;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
126 t->chunkId = ptt->chunkId;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
127 t->byteCount = ptt->byteCount;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
128 t->chunkDeleted = 0;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
129 t->serialNumber = 0;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
130 t->sequenceNumber = ptt->sequenceNumber;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
131
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
132 /* Do extra header info stuff */
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
133
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
134 if (ptt->chunkId & EXTRA_HEADER_INFO_FLAG) {
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
135 t->chunkId = 0;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
136 t->byteCount = 0;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
137
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
138 t->extraHeaderInfoAvailable = 1;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
139 t->extraParentObjectId =
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
140 ptt->chunkId & (~(ALL_EXTRA_FLAGS));
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
141 t->extraIsShrinkHeader =
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
142 (ptt->chunkId & EXTRA_SHRINK_FLAG) ? 1 : 0;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
143 t->extraShadows =
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
144 (ptt->chunkId & EXTRA_SHADOWS_FLAG) ? 1 : 0;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
145 t->extraObjectType =
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
146 ptt->objectId >> EXTRA_OBJECT_TYPE_SHIFT;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
147 t->objectId &= ~EXTRA_OBJECT_TYPE_MASK;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
148
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
149 if (t->extraObjectType == YAFFS_OBJECT_TYPE_HARDLINK) {
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
150 t->extraEquivalentObjectId = ptt->byteCount;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
151 } else {
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
152 t->extraFileLength = ptt->byteCount;
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
153 }
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
154 }
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
155 }
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
156
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
157 yaffs_DumpPackedTags2TagsPart(ptt);
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
158 yaffs_DumpTags2(t);
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
159
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
160 }
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
161
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
162
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
163 void yaffs_UnpackTags2(yaffs_ExtendedTags * t, yaffs_PackedTags2 * pt)
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
164 {
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
165
255
467bb4a77339 Improve handling of ecc on tags
charles
parents: 211
diff changeset
166 yaffs_ECCResult eccResult = YAFFS_ECC_RESULT_NO_ERROR;
467bb4a77339 Improve handling of ecc on tags
charles
parents: 211
diff changeset
167
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
168 if (pt->t.sequenceNumber != 0xFFFFFFFF) {
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
169 /* Page is in use */
255
467bb4a77339 Improve handling of ecc on tags
charles
parents: 211
diff changeset
170 #ifndef YAFFS_IGNORE_TAGS_ECC
24
4ebabd859f38 Some improvements to garbage collection and st_xxx to yst_xxx changes
charles
parents: 15
diff changeset
171 {
4ebabd859f38 Some improvements to garbage collection and st_xxx to yst_xxx changes
charles
parents: 15
diff changeset
172 yaffs_ECCOther ecc;
148
1d8892b579f5 Better retirement and erasure checking.
charles
parents: 79
diff changeset
173 int result;
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
174 yaffs_ECCCalculateOther((unsigned char *)&pt->t,
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
175 sizeof
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
176 (yaffs_PackedTags2TagsPart),
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
177 &ecc);
148
1d8892b579f5 Better retirement and erasure checking.
charles
parents: 79
diff changeset
178 result =
79
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
179 yaffs_ECCCorrectOther((unsigned char *)&pt->t,
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
180 sizeof
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
181 (yaffs_PackedTags2TagsPart),
3eaa6f96e945 lindent
marty
parents: 50
diff changeset
182 &pt->ecc, &ecc);
148
1d8892b579f5 Better retirement and erasure checking.
charles
parents: 79
diff changeset
183 switch(result){
205
f95fdc6123fb Cleanup patch - Remove all trailing whitespace and fix a few typos.
wookey
parents: 177
diff changeset
184 case 0:
255
467bb4a77339 Improve handling of ecc on tags
charles
parents: 211
diff changeset
185 eccResult = YAFFS_ECC_RESULT_NO_ERROR;
148
1d8892b579f5 Better retirement and erasure checking.
charles
parents: 79
diff changeset
186 break;
205
f95fdc6123fb Cleanup patch - Remove all trailing whitespace and fix a few typos.
wookey
parents: 177
diff changeset
187 case 1:
255
467bb4a77339 Improve handling of ecc on tags
charles
parents: 211
diff changeset
188 eccResult = YAFFS_ECC_RESULT_FIXED;
148
1d8892b579f5 Better retirement and erasure checking.
charles
parents: 79
diff changeset
189 break;
1d8892b579f5 Better retirement and erasure checking.
charles
parents: 79
diff changeset
190 case -1:
255
467bb4a77339 Improve handling of ecc on tags
charles
parents: 211
diff changeset
191 eccResult = YAFFS_ECC_RESULT_UNFIXED;
148
1d8892b579f5 Better retirement and erasure checking.
charles
parents: 79
diff changeset
192 break;
1d8892b579f5 Better retirement and erasure checking.
charles
parents: 79
diff changeset
193 default:
255
467bb4a77339 Improve handling of ecc on tags
charles
parents: 211
diff changeset
194 eccResult = YAFFS_ECC_RESULT_UNKNOWN;
148
1d8892b579f5 Better retirement and erasure checking.
charles
parents: 79
diff changeset
195 }
24
4ebabd859f38 Some improvements to garbage collection and st_xxx to yst_xxx changes
charles
parents: 15
diff changeset
196 }
4ebabd859f38 Some improvements to garbage collection and st_xxx to yst_xxx changes
charles
parents: 15
diff changeset
197 #endif
6
ffe653f3cb4f *** empty log message ***
charles
parents:
diff changeset
198 }
7
ddfefbbf40d3 *** empty log message ***
charles
parents: 6
diff changeset
199
255
467bb4a77339 Improve handling of ecc on tags
charles
parents: 211
diff changeset
200 yaffs_UnpackTags2TagsPart(t,&pt->t);
467bb4a77339 Improve handling of ecc on tags
charles
parents: 211
diff changeset
201
467bb4a77339 Improve handling of ecc on tags
charles
parents: 211
diff changeset
202 t->eccResult = eccResult;
467bb4a77339 Improve handling of ecc on tags
charles
parents: 211
diff changeset
203
7
ddfefbbf40d3 *** empty log message ***
charles
parents: 6
diff changeset
204 yaffs_DumpPackedTags2(pt);
ddfefbbf40d3 *** empty log message ***
charles
parents: 6
diff changeset
205 yaffs_DumpTags2(t);
ddfefbbf40d3 *** empty log message ***
charles
parents: 6
diff changeset
206
6
ffe653f3cb4f *** empty log message ***
charles
parents:
diff changeset
207 }
211
fad21fd1971d Check in inband tags, some extra yaffs direct functions and some other changes
charles
parents: 205
diff changeset
208