X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_guts.h;h=284e206040eb14c485d8fe55cf0a86307679b2f2;hp=450672496f0f326971d785065f17c437a4902539;hb=7211ad39b355b558a4f8a97bc4821ee859888bd6;hpb=40c386c7a14ebfa8afc14562f3b33a416831b26d diff --git a/yaffs_guts.h b/yaffs_guts.h index 4506724..284e206 100644 --- a/yaffs_guts.h +++ b/yaffs_guts.h @@ -108,6 +108,9 @@ #define YAFFS_LOWEST_SEQUENCE_NUMBER 0x00001000 #define YAFFS_HIGHEST_SEQUENCE_NUMBER 0xEFFFFF00 +/* Special sequence number for bad block that failed to be marked bad */ +#define YAFFS_SEQUENCE_BAD_BLOCK 0xFFFF0000 + /* ChunkCache is used for short read/write operations.*/ typedef struct { struct yaffs_ObjectStruct *object; @@ -132,12 +135,12 @@ typedef struct { #ifndef CONFIG_YAFFS_NO_YAFFS1 typedef struct { - unsigned chunkId:20; - unsigned serialNumber:2; - unsigned byteCount:10; - unsigned objectId:18; - unsigned ecc:12; - unsigned unusedStuff:2; + unsigned chunkId:20; + unsigned serialNumber:2; + unsigned byteCountLSB:10; + unsigned objectId:18; + unsigned ecc:12; + unsigned byteCountMSB:2; } yaffs_Tags; @@ -420,7 +423,8 @@ struct yaffs_ObjectStruct { __u8 deferedFree:1; /* For Linux kernel. Object is removed from NAND, but is * still in the inode cache. Free of object is defered. * until the inode is released. - */ + */ + __u8 beingCreated:1; /* This object is still being created so skip some checks. */ __u8 serial; /* serial number of chunk in NAND. Cached here */ __u16 sum; /* sum of the name to speed searching */ @@ -436,8 +440,8 @@ struct yaffs_ObjectStruct { struct yaffs_ObjectStruct *parent; struct ylist_head siblings; - /* Where's my object header in NAND? */ - int chunkId; + /* Where's my object header in NAND? */ + int hdrChunk; int nDataChunks; /* Number of data chunks attached to the file. */ @@ -501,8 +505,7 @@ typedef struct { int structType; __u32 objectId; __u32 parentId; - int chunkId; - + int hdrChunk; yaffs_ObjectType variantType:3; __u8 deleted:1; __u8 softDeleted:1; @@ -573,9 +576,10 @@ struct yaffs_DeviceStruct { int (*readChunkFromNAND) (struct yaffs_DeviceStruct * dev, int chunkInNAND, __u8 * data, yaffs_Spare * spare); - int (*eraseBlockInNAND) (struct yaffs_DeviceStruct * dev, - int blockInNAND); - int (*initialiseNAND) (struct yaffs_DeviceStruct * dev); + int (*eraseBlockInNAND) (struct yaffs_DeviceStruct * dev, + int blockInNAND); + int (*initialiseNAND) (struct yaffs_DeviceStruct * dev); + int (*deinitialiseNAND) (struct yaffs_DeviceStruct * dev); #ifdef CONFIG_YAFFS_YAFFS2 int (*writeChunkWithTagsToNAND) (struct yaffs_DeviceStruct * dev, @@ -689,10 +693,14 @@ struct yaffs_DeviceStruct { yaffs_TnodeList *allocatedTnodeList; int isDoingGC; + int gcBlock; + int gcChunk; int nObjectsCreated; yaffs_Object *freeObjects; int nFreeObjects; + + int nHardLinks; yaffs_ObjectList *allocatedObjectList;