__u8 tagByte1;
__u8 tagByte2;
__u8 tagByte3;
- __u8 pageStatus;
+ __u8 pageStatus; // Currently unused, but sort of set aside to distinguish
+ // unused - vs- used -vs- deleted chunks. We achieve this by
+ // using the objectId tags.
__u8 blockStatus;
__u8 tagByte4;
__u8 tagByte5;
// Block data in RAM
typedef enum {
- YAFFS_BLOCK_STATE_UNKNOWN = 0,
+ YAFFS_BLOCK_STATE_UddNKNOWN = 0,
+ YAFFS_BLOCK_STATE_SCANNING, // Used while the block is being scanned.
+ // NB Don't erase blocks while they're being scanned
YAFFS_BLOCK_STATE_EMPTY, // This block is empty
void *genericDevice; // Pointer to device context
// On an mtd this holds the mtd pointer.
+
+#ifdef __KERNEL__
+
struct semaphore sem;// Semaphore for waiting on erasure.
+
+#endif
// NAND access functions (Must be set before calling YAFFS)
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);
-
-
+#ifdef __KERNEL__
+ void (*putSuperFunc)(struct super_block *sb);
+#endif
+
// Runtime parameters.
yaffs_BlockInfo *blockInfo;
int nErasedBlocks;
// Link operations
yaffs_Object *yaffs_Link(yaffs_Object *parent, const char *name, yaffs_Object *equivalentObject);
+yaffs_Object *yaffs_GetEquivalentObject(yaffs_Object *obj);
+
// Symlink operations
yaffs_Object *yaffs_MknodSymLink(yaffs_Object *parent, const char *name, __u32 mode, __u32 uid, __u32 gid, const char *alias);
char *yaffs_GetSymlinkAlias(yaffs_Object *obj);