X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_tagscompat.c;h=d594d6193245ff7ae2f09c5ea063906c56bf7225;hp=2cf783e65a9bf998ba53df8c9738fbe9350124e5;hb=e1ac494e05a5dc7ab61d799af815d103a11d318c;hpb=ea7c7678c50a48bcb278e1233569f6a921dea0b5 diff --git a/yaffs_tagscompat.c b/yaffs_tagscompat.c index 2cf783e..d594d61 100644 --- a/yaffs_tagscompat.c +++ b/yaffs_tagscompat.c @@ -1,16 +1,14 @@ /* - * YAFFS: Yet another FFS. A NAND-flash specific file system. - * yaffs_tagscompat.h: Tags compatability layer to use YAFFS1 formatted NAND. + * YAFFS: Yet Another Flash File System. A NAND-flash specific file system. * - * Copyright (C) 2002 Aleph One Ltd. + * Copyright (C) 2002-2007 Aleph One Ltd. + * for Toby Churchill Ltd and Brightstar Engineering * * Created by Charles Manning * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. - * - * $Id: yaffs_tagscompat.c,v 1.7 2005-09-20 23:12:38 charles Exp $ */ #include "yaffs_guts.h" @@ -455,20 +453,22 @@ int yaffs_TagsCompatabilityReadChunkWithTagsFromNAND(yaffs_Device * dev, int deleted = (yaffs_CountBits(spare.pageStatus) < 7) ? 1 : 0; - yaffs_GetTagsFromSpare(dev, &spare, &tags); - eTags->chunkDeleted = deleted; - eTags->objectId = tags.objectId; - eTags->chunkId = tags.chunkId; - eTags->byteCount = tags.byteCount; - eTags->serialNumber = tags.serialNumber; eTags->eccResult = eccResult; eTags->blockBad = 0; /* We're reading it */ /* therefore it is not a bad block */ - eTags->chunkUsed = (memcmp(&spareFF, &spare, sizeof(spareFF)) != 0) ? 1 : 0; + + if (eTags->chunkUsed) { + yaffs_GetTagsFromSpare(dev, &spare, &tags); + + eTags->objectId = tags.objectId; + eTags->chunkId = tags.chunkId; + eTags->byteCount = tags.byteCount; + eTags->serialNumber = tags.serialNumber; + } } return YAFFS_OK;