X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_guts.h;h=96c576f7ef04c5d03a9d021e33017acfc63fa772;hp=c222c09c02bf2d02b37ea0665b8f18149b19535e;hb=399e637051f0912a625e74cb072cbc8528b054f8;hpb=6d328375504ad23f4731f17fcf12eeeb26a55f21 diff --git a/yaffs_guts.h b/yaffs_guts.h index c222c09..96c576f 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.4 2005-04-24 09:57:06 charles Exp $ + * $Id: yaffs_guts.h,v 1.10 2005-07-26 23:04:34 charles Exp $ */ #ifndef __YAFFS_GUTS_H__ @@ -179,16 +179,17 @@ typedef struct unsigned sequenceNumber; // The sequence number of this block // Extra info if this is an object header (YAFFS2 only) - unsigned extraHeaderInfoAvailable; - unsigned extraParentObjectId; - unsigned extraIsShrinkHeader; - yaffs_ObjectType extraObjectType; + unsigned extraHeaderInfoAvailable; // There is extra info available if this is not zero + unsigned extraParentObjectId; // The parent object + unsigned extraIsShrinkHeader; // Is it a shrink header? + + yaffs_ObjectType extraObjectType; // What object type? - unsigned extraFileLength; - unsigned extraEquivalentObjectId; + unsigned extraFileLength; // Length if it is a file + unsigned extraEquivalentObjectId; // Equivalent object Id if it is a hard link - unsigned validMarker1; + unsigned validMarker1; } yaffs_ExtendedTags; @@ -282,16 +283,16 @@ typedef struct YCHAR name[YAFFS_MAX_NAME_LENGTH + 1]; // Thes following apply to directories, files, symlinks - not hard links - __u32 st_mode; // protection + __u32 yst_mode; // protection #ifdef CONFIG_YAFFS_WINCE __u32 notForWinCE[5]; #else - __u32 st_uid; // user ID of owner - __u32 st_gid; // group ID of owner - __u32 st_atime; // time of last access - __u32 st_mtime; // time of last modification - __u32 st_ctime; // time of last change + __u32 yst_uid; // user ID of owner + __u32 yst_gid; // group ID of owner + __u32 yst_atime; // time of last access + __u32 yst_mtime; // time of last modification + __u32 yst_ctime; // time of last change #endif // File size applies to files only @@ -303,7 +304,7 @@ typedef struct // Alias is for symlinks only. YCHAR alias[YAFFS_MAX_ALIAS_LENGTH + 1]; - __u32 st_rdev; // device stuff for block and char devices (maj/min) + __u32 yst_rdev; // device stuff for block and char devices (maj/min) #ifdef CONFIG_YAFFS_WINCE __u32 win_ctime[2]; @@ -424,15 +425,15 @@ struct yaffs_ObjectStruct struct list_head siblings; // siblings in a directory // also used for linking up the free list - // Where's my data in NAND? + // Where's my object header in NAND? int chunkId; // where it lives - int nDataChunks; + int nDataChunks; // Number of data chunks attached to the file. __u32 objectId; // the object id value - __u32 st_mode; // protection + __u32 yst_mode; // protection #ifdef CONFIG_YAFFS_SHORT_NAMES_IN_RAM YCHAR shortName[YAFFS_SHORT_NAME_LENGTH+1]; @@ -447,14 +448,14 @@ struct yaffs_ObjectStruct __u32 win_mtime[2]; __u32 win_atime[2]; #else - __u32 st_uid; // user ID of owner - __u32 st_gid; // group ID of owner - __u32 st_atime; // time of last access - __u32 st_mtime; // time of last modification - __u32 st_ctime; // time of last change + __u32 yst_uid; // user ID of owner + __u32 yst_gid; // group ID of owner + __u32 yst_atime; // time of last access + __u32 yst_mtime; // time of last modification + __u32 yst_ctime; // time of last change #endif - __u32 st_rdev; // device stuff for block and char devices + __u32 yst_rdev; // device stuff for block and char devices @@ -504,6 +505,9 @@ typedef struct { struct yaffs_DeviceStruct { + struct list_head devList; + const char *name; + // Entry parameters set up way early. Yaffs sets up the rest. int nBytesPerChunk; // Should be a power of 2 >= 512 int nChunksPerBlock; // does not need to be a power of 2 @@ -558,6 +562,12 @@ struct yaffs_DeviceStruct int isMounted; + // Stuff to support block offsetting to support start block zero + int internalStartBlock; + int internalEndBlock; + int blockOffset; + int chunkOffset; + // Block Info yaffs_BlockInfo *blockInfo; __u8 *chunkBits; // bitmap of chunks in use @@ -576,6 +586,7 @@ struct yaffs_DeviceStruct int nFreeTnodes; yaffs_TnodeList *allocatedTnodeList; + int isDoingGC; int nObjectsCreated; yaffs_Object *freeObjects; @@ -649,12 +660,12 @@ typedef struct yaffs_DeviceStruct yaffs_Device; // Function to manipulate block info static Y_INLINE yaffs_BlockInfo* yaffs_GetBlockInfo(yaffs_Device *dev, int blk) { - if(blk < dev->startBlock || blk > dev->endBlock) + 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->startBlock]; + return &dev->blockInfo[blk - dev->internalStartBlock]; } @@ -686,7 +697,7 @@ int yaffs_GetAttributes(yaffs_Object *obj, struct iattr *attr); // File operations int yaffs_ReadDataFromFile(yaffs_Object *obj, __u8 *buffer, __u32 offset, int nBytes); -int yaffs_WriteDataToFile(yaffs_Object *obj, const __u8 *buffer, __u32 offset, int nBytes); +int yaffs_WriteDataToFile(yaffs_Object *obj, const __u8 *buffer, __u32 offset, int nBytes, int writeThrough); int yaffs_ResizeFile(yaffs_Object *obj, int newSize); yaffs_Object *yaffs_MknodFile(yaffs_Object *parent,const YCHAR *name, __u32 mode, __u32 uid, __u32 gid);