#define YAFFS_MAX_SHORT_OP_CACHES 20
-#define YAFFS_N_TEMP_BUFFERS 4
+#define YAFFS_N_TEMP_BUFFERS 6
/* We limit the number attempts at sucessfully saving a chunk of data.
* Small-page devices have 32 pages per block; large-page devices have 64.
__u32 win_ctime[2];
__u32 win_atime[2];
__u32 win_mtime[2];
- __u32 roomToGrow[4];
#else
- __u32 roomToGrow[10];
+ __u32 roomToGrow[6];
+
#endif
+ __u32 inbandShadowsObject;
+ __u32 inbandIsShrink;
+ __u32 reservedSpace[2];
int shadowsObject; /* This object header shadows the specified object if > 0 */
/* isShrink applies to object headers written when we shrink the file (ie resize) */
} yaffs_FileStructure;
typedef struct {
- struct list_head children; /* list of child links */
+ struct ylist_head children; /* list of child links */
} yaffs_DirectoryStructure;
typedef struct {
struct yaffs_DeviceStruct *myDev; /* The device I'm on */
- struct list_head hashLink; /* list of objects in this hash bucket */
+ struct ylist_head hashLink; /* list of objects in this hash bucket */
- struct list_head hardLinks; /* all the equivalent hard linked objects */
+ struct ylist_head hardLinks; /* all the equivalent hard linked objects */
/* directory structure stuff */
/* also used for linking up the free list */
struct yaffs_ObjectStruct *parent;
- struct list_head siblings;
+ struct ylist_head siblings;
/* Where's my object header in NAND? */
int chunkId;
typedef struct yaffs_ObjectList_struct yaffs_ObjectList;
typedef struct {
- struct list_head list;
+ struct ylist_head list;
int count;
} yaffs_ObjectBucket;
/*----------------- Device ---------------------------------*/
struct yaffs_DeviceStruct {
- struct list_head devList;
+ struct ylist_head devList;
const char *name;
/* Entry parameters set up way early. Yaffs sets up the rest.*/
yaffs_ExtendedTags * tags);
int (*markNANDBlockBad) (struct yaffs_DeviceStruct * dev, int blockNo);
int (*queryNANDBlock) (struct yaffs_DeviceStruct * dev, int blockNo,
- yaffs_BlockState * state, int *sequenceNumber);
+ yaffs_BlockState * state, __u32 *sequenceNumber);
#endif
int isYaffs2;
void (*markSuperBlockDirty)(void * superblock);
int wideTnodesDisabled; /* Set to disable wide tnodes */
-
+
+ YCHAR *pathDividers; /* String of legal path dividers */
/* End of stuff that must be set before initialisation. */
__u32 tnodeWidth;
__u32 tnodeMask;
- /* Stuff to support various file offses to chunk/offset translations */
- /* "Crumbs" for nDataBytesPerChunk not being a power of 2 */
- __u32 crumbMask;
- __u32 crumbShift;
- __u32 crumbsPerChunk;
-
- /* Straight shifting for nDataBytesPerChunk being a power of 2 */
- __u32 chunkShift;
- __u32 chunkMask;
+ /* Stuff for figuring out file offset to chunk conversions */
+ __u32 chunkShift; /* Shift value */
+ __u32 chunkDiv; /* Divisor after shifting: 1 for power-of-2 sizes */
+ __u32 chunkMask; /* Mask to use for power-of-2 case */
+ /* Stuff to handle inband tags */
+ int inbandTags;
+ __u32 totalBytesPerChunk;
#ifdef __KERNEL__
int nUnlinkedFiles; /* Count of unlinked files. */
int nBackgroundDeletions; /* Count of background deletions. */
-
+
+ /* Temporary buffer management */
yaffs_TempBuffer tempBuffer[YAFFS_N_TEMP_BUFFERS];
int maxTemp;
+ int tempInUse;
int unmanagedTempAllocations;
int unmanagedTempDeallocations;
__u32 head;
} yaffs_CheckpointValidity;
-/* Function to manipulate block info */
-static Y_INLINE yaffs_BlockInfo *yaffs_GetBlockInfo(yaffs_Device * dev, int blk)
-{
- if (blk < dev->internalStartBlock || blk > dev->internalEndBlock) {
- T(YAFFS_TRACE_ERROR,
- (TSTR
- ("**>> yaffs: getBlockInfo block %d is not valid" TENDSTR),
- blk));
- YBUG();
- }
- return &dev->blockInfo[blk - dev->internalStartBlock];
-}
/*----------------------- YAFFS Functions -----------------------*/
int yaffs_CheckFF(__u8 * buffer, int nBytes);
void yaffs_HandleChunkError(yaffs_Device *dev, yaffs_BlockInfo *bi);
+__u8 *yaffs_GetTempBuffer(yaffs_Device * dev, int lineNo);
+void yaffs_ReleaseTempBuffer(yaffs_Device * dev, __u8 * buffer, int lineNo);
+
#endif