2 * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
4 * Copyright (C) 2002-2007 Aleph One Ltd.
5 * for Toby Churchill Ltd and Brightstar Engineering
7 * Created by Charles Manning <charles@aleph1.co.uk>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
17 #include "yaffs_packedtags1.h"
20 void yaffs_PackTags1(yaffs_PackedTags1 * pt, const yaffs_ExtendedTags * t)
22 pt->chunkId = t->chunkId;
23 pt->serialNumber = t->serialNumber;
24 pt->byteCount = t->byteCount;
25 pt->objectId = t->objectId;
27 pt->deleted = (t->chunkDeleted) ? 0 : 1;
29 pt->shouldBeFF = 0xFFFFFFFF;
33 void yaffs_UnpackTags1(yaffs_ExtendedTags * t, const yaffs_PackedTags1 * pt)
35 static const __u8 allFF[] =
36 { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
39 if (memcmp(allFF, pt, sizeof(yaffs_PackedTags1))) {
41 if (pt->shouldBeFF != 0xFFFFFFFF) {
45 t->objectId = pt->objectId;
46 t->chunkId = pt->chunkId;
47 t->byteCount = pt->byteCount;
48 t->eccResult = YAFFS_ECC_RESULT_NO_ERROR;
49 t->chunkDeleted = (pt->deleted) ? 0 : 1;
50 t->serialNumber = pt->serialNumber;
52 memset(t, 0, sizeof(yaffs_ExtendedTags));