*** empty log message ***
[yaffs/.git] / yaffs_guts.h
index 0fe8f74557b7ca942ad0d1c9b5591102606cc0e8..eb1d8b8ee4cf716391062f49e413f7275510941b 100644 (file)
  *
  * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
  *
- * $Id: yaffs_guts.h,v 1.14 2003-01-14 23:15:32 charles Exp $
+ * $Id: yaffs_guts.h,v 1.18 2004-10-20 20:12:43 charles Exp $
  */
 
 #ifndef __YAFFS_GUTS_H__
 #define __YAFFS_GUTS_H__
 
-#include "devextras.h"
-
+#include "yportenv.h"
 
 #define YAFFS_OK       1
 #define YAFFS_FAIL  0
@@ -62,8 +61,6 @@
 #define YAFFS_NOBJECT_BUCKETS          256
 
 
-#define YAFFS_RESERVED_BLOCKS          8
-
 #define YAFFS_OBJECT_SPACE                     0x40000
 #define YAFFS_MAX_NAME_LENGTH          255
 #define YAFFS_SHORT_NAME_LENGTH                15
@@ -363,6 +360,8 @@ struct  yaffs_ObjectStruct
 
 #ifdef __KERNEL__
        struct inode *myInode;
+       __u8  deferedFree;   // YAFFS has removed the object from NAND, but it is being kept
+                            // Alive until the inode is cleared to prevent inode inconsistencies.
 #endif
 
 
@@ -399,9 +398,11 @@ struct yaffs_DeviceStruct
 {
        // Entry parameters set up way early. Yaffs sets up the rest.
        int   nBytesPerChunk;    // Should be a power of 2 >= 512
-       int       nChunksPerBlock;
-       int   startBlock;       // Start block we're allowed to use
-       int   endBlock;         // End block we're allowed to use
+       int       nChunksPerBlock;       // does not need to be a power of 2
+       int   startBlock;                // Start block we're allowed to use
+       int   endBlock;                  // End block we're allowed to use
+       int   nReservedBlocks;   // We want this tuneable so that we can reduce
+                                                        // reserved blocks on NOR and RAM.
        
        int   useNANDECC;               // Flag to decide whether or not to use NANDECC
        int   nShortOpCaches;   // If <= 0, then short op caching is disabled, else
@@ -466,7 +467,6 @@ struct yaffs_DeviceStruct
                
        int   currentDirtyChecker;      // Used to find current dirtiest block
        
-       int   garbageCollectionRequired;
        
        // Operations since mount
        int nPageWrites;
@@ -474,6 +474,7 @@ struct yaffs_DeviceStruct
        int nBlockErasures;
        int nGCCopies;
        int garbageCollections;
+       int passiveGarbageCollections;
        int nRetriedWrites;
        int nRetiredBlocks;
        int eccFixed;
@@ -491,8 +492,6 @@ struct yaffs_DeviceStruct
 //     yaffs_Spare bufferedSpare[YAFFS_CHUNKS_PER_BLOCK];
        int bufferedBlock;      // Which block is buffered here?
        int doingBufferedBlockRewrite;
-       
-       int blockSelectedForGC;
 
        yaffs_ChunkCache *srCache;
        int srLastUse;
@@ -578,6 +577,9 @@ yaffs_Object *yaffs_LostNFound(yaffs_Device *dev);
 void  yfsd_WinFileTimeNow(__u32 target[2]);
 #endif
 
+#ifdef __KERNEL__
+void yaffs_HandleDeferedFree(yaffs_Object *obj);
+#endif
 
 // Debug dump 
 int yaffs_DumpObject(yaffs_Object *obj);
@@ -588,3 +590,4 @@ void yaffs_GutsTest(yaffs_Device *dev);
 
 #endif
 
+