X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_guts.c;h=0ab8d8a051dcf81706e0f6ffce91e167ba144fe8;hp=c5be37ff748c02f431dde13b2ad10f7186737cfd;hb=6eceb5b64c0f77ca1cde968025e50a4f3f69f311;hpb=69081134a4d0f5059560e10bc49774b1063a6c87 diff --git a/yaffs_guts.c b/yaffs_guts.c index c5be37f..0ab8d8a 100644 --- a/yaffs_guts.c +++ b/yaffs_guts.c @@ -13,7 +13,7 @@ */ const char *yaffs_guts_c_version = - "$Id: yaffs_guts.c,v 1.26 2005-12-19 21:46:07 charles Exp $"; + "$Id: yaffs_guts.c,v 1.28 2006-02-02 22:14:44 charles Exp $"; #include "yportenv.h" @@ -335,6 +335,7 @@ static Y_INLINE int yaffs_StillSomeChunkBits(yaffs_Device * dev, int blk) static Y_INLINE int yaffs_HashFunction(int n) { + n = abs(n); return (n % YAFFS_NOBJECT_BUCKETS); } @@ -4437,7 +4438,7 @@ static int yaffs_ScanBackwards(yaffs_Device * dev) yaffs_Object *in; yaffs_Object *parent; int nBlocks = dev->internalEndBlock - dev->internalStartBlock + 1; - + int itsUnlinked; __u8 *chunkData; yaffs_BlockIndex *blockIndex = NULL; @@ -4847,11 +4848,8 @@ static int yaffs_ScanBackwards(yaffs_Device * dev) yaffs_AddObjectToDirectory(parent, in); - if ((parent == dev->deletedDir || - parent == dev->unlinkedDir)) { - /* If it is unlinked at start up then it wants deleting */ - in->deleted = 1; - } + itsUnlinked = (parent == dev->deletedDir) || + (parent == dev->unlinkedDir); if (oh->isShrink) { /* Mark the block as having a shrinkHeader */ @@ -4894,7 +4892,7 @@ static int yaffs_ScanBackwards(yaffs_Device * dev) break; case YAFFS_OBJECT_TYPE_HARDLINK: - if(!in->deleted) { + if(!itsUnlinked) { in->variant.hardLinkVariant.equivalentObjectId = oh->equivalentObjectId; in->hardLinks.next =