X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_guts.h;h=aaeda26e1c29703f36dee9560b0d647c0a890766;hp=c5eee97309a3d0ed6d8f4b90781bf5479fde676d;hb=751cba724040d777d1768dd5d4997039962d2608;hpb=64239466cac1b316650213aaa07c92f57c3e7861 diff --git a/yaffs_guts.h b/yaffs_guts.h index c5eee97..aaeda26 100644 --- a/yaffs_guts.h +++ b/yaffs_guts.h @@ -14,7 +14,7 @@ * * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. * - * $Id: yaffs_guts.h,v 1.15 2005-10-07 02:46:50 charles Exp $ + * $Id: yaffs_guts.h,v 1.20 2006-03-08 07:59:20 charles Exp $ */ #ifndef __YAFFS_GUTS_H__ @@ -325,7 +325,7 @@ union yaffs_Tnode_union { #else union yaffs_Tnode_union *internal[YAFFS_NTNODES_INTERNAL]; #endif - __u16 level0[YAFFS_NTNODES_LEVEL0]; +/* __u16 level0[YAFFS_NTNODES_LEVEL0]; */ }; @@ -386,15 +386,14 @@ struct yaffs_ObjectStruct { * object might be created before the data * is available (ie. file data records appear before the header). */ - __u8 serial; /* serial number of chunk in NAND. Cached here */ + __u8 lazyLoaded:1; /* This object has been lazy loaded and is missing some detail */ __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 lazyLoaded; /* Vital info has been loaded from tags. Not all info available. */ - + __u8 serial; /* serial number of chunk in NAND. Cached here */ __u16 sum; /* sum of the name to speed searching */ struct yaffs_DeviceStruct *myDev; /* The device I'm on */ @@ -533,6 +532,8 @@ struct yaffs_DeviceStruct { */ void (*removeObjectCallback)(struct yaffs_ObjectStruct *obj); + int wideTnodesDisabled; /* Set to disable wide tnodes */ + /* End of stuff that must be set before initialisation. */ @@ -540,6 +541,11 @@ struct yaffs_DeviceStruct { __u16 chunkGroupBits; /* 0 for devices <= 32MB. else log2(nchunks) - 16 */ __u16 chunkGroupSize; /* == 2^^chunkGroupBits */ + + /* Stuff to support wide tnodes */ + __u32 tnodeWidth; + __u32 tnodeMask; + #ifdef __KERNEL__ @@ -561,8 +567,9 @@ struct yaffs_DeviceStruct { /* Block Info */ yaffs_BlockInfo *blockInfo; - int blockInfoAlt; /* was allocated using alternative strategy */ __u8 *chunkBits; /* bitmap of chunks in use */ + unsigned blockInfoAlt:1; /* was allocated using alternative strategy */ + unsigned chunkBitsAlt:1; /* was allocated using alternative strategy */ int chunkBitmapStride; /* Number of bytes of chunkBits per block. * Must be consistent with nChunksPerBlock. */ @@ -668,6 +675,8 @@ static Y_INLINE yaffs_BlockInfo *yaffs_GetBlockInfo(yaffs_Device * dev, int blk) int yaffs_GutsInitialise(yaffs_Device * dev); void yaffs_Deinitialise(yaffs_Device * dev); +void yaffs_FlushEntireDeviceCache(yaffs_Device *dev); + int yaffs_GetNumberOfFreeChunks(yaffs_Device * dev); int yaffs_RenameObject(yaffs_Object * oldDir, const YCHAR * oldName,