-
- if(pt->t.sequenceNumber == 0xFFFFFFFF)
- {
- memset(t,0,sizeof(yaffs_ExtendedTags));
-
+}
+
+void yaffs_PackTags2TagsPart(yaffs_PackedTags2TagsPart * ptt, const yaffs_ExtendedTags * t)
+{
+ ptt->chunkId = t->chunkId;
+ ptt->sequenceNumber = t->sequenceNumber;
+ ptt->byteCount = t->byteCount;
+ ptt->objectId = t->objectId;
+
+ if (t->chunkId == 0 && t->extraHeaderInfoAvailable) {
+ /* Store the extra header info instead */
+ /* We save the parent object in the chunkId */
+ ptt->chunkId = EXTRA_HEADER_INFO_FLAG
+ | t->extraParentObjectId;
+ if (t->extraIsShrinkHeader) {
+ ptt->chunkId |= EXTRA_SHRINK_FLAG;
+ }
+ 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) {
+ ptt->byteCount = t->extraEquivalentObjectId;
+ } else if (t->extraObjectType == YAFFS_OBJECT_TYPE_FILE) {
+ ptt->byteCount = t->extraFileLength;
+ } else {
+ ptt->byteCount = 0;
+ }