Change direct handle management to use an inode layer to make it consistent with...
[yaffs2.git] / yaffs_guts.h
index 3385bd4c6a8b3c86b6d5ca56afd53f49de9e78bf..48e55339bc047ed80c23d14df9c4ebef06535e59 100644 (file)
@@ -405,6 +405,8 @@ typedef union {
        yaffs_HardLinkStructure hardLinkVariant;
 } yaffs_ObjectVariant;
 
        yaffs_HardLinkStructure hardLinkVariant;
 } yaffs_ObjectVariant;
 
+
+
 struct yaffs_ObjectStruct {
        __u8 deleted:1;         /* This should only apply to unlinked files. */
        __u8 softDeleted:1;     /* it has also been soft deleted */
 struct yaffs_ObjectStruct {
        __u8 deleted:1;         /* This should only apply to unlinked files. */
        __u8 softDeleted:1;     /* it has also been soft deleted */
@@ -453,10 +455,6 @@ struct yaffs_ObjectStruct {
        YCHAR shortName[YAFFS_SHORT_NAME_LENGTH + 1];
 #endif
 
        YCHAR shortName[YAFFS_SHORT_NAME_LENGTH + 1];
 #endif
 
-#ifndef __KERNEL__
-       __u32 inUse;
-#endif
-
 #ifdef CONFIG_YAFFS_WINCE
        __u32 win_ctime[2];
        __u32 win_mtime[2];
 #ifdef CONFIG_YAFFS_WINCE
        __u32 win_ctime[2];
        __u32 win_mtime[2];
@@ -471,10 +469,7 @@ struct yaffs_ObjectStruct {
 
        __u32 yst_rdev;
 
 
        __u32 yst_rdev;
 
-#ifdef __KERNEL__
-       struct inode *myInode;
-
-#endif
+       void *myInode;
 
        yaffs_ObjectType variantType;
 
 
        yaffs_ObjectType variantType;
 
@@ -532,6 +527,7 @@ typedef struct {
 
 /*----------------- Device ---------------------------------*/
 
 
 /*----------------- Device ---------------------------------*/
 
+
 struct yaffs_DeviceStruct {
        struct ylist_head devList;
        const char *name;
 struct yaffs_DeviceStruct {
        struct ylist_head devList;
        const char *name;
@@ -596,8 +592,9 @@ struct yaffs_DeviceStruct {
        int isYaffs2;
 
        /* The removeObjectCallback function must be supplied by OS flavours that
        int isYaffs2;
 
        /* The removeObjectCallback function must be supplied by OS flavours that
-        * need it. The Linux kernel does not use this, but yaffs direct does use
-        * it to implement the faster readdir
+        * need it.
+         * yaffs direct uses it to implement the faster readdir.
+         * Linux uses it to protect the directory during unlocking.
         */
        void (*removeObjectCallback)(struct yaffs_ObjectStruct *obj);
 
         */
        void (*removeObjectCallback)(struct yaffs_ObjectStruct *obj);
 
@@ -637,10 +634,14 @@ struct yaffs_DeviceStruct {
 
        struct semaphore sem;   /* Semaphore for waiting on erasure.*/
        struct semaphore grossLock;     /* Gross locking semaphore */
 
        struct semaphore sem;   /* Semaphore for waiting on erasure.*/
        struct semaphore grossLock;     /* Gross locking semaphore */
+       struct rw_semaphore dirLock; /* Lock the directory structure */
        __u8 *spareBuffer;      /* For mtdif2 use. Don't know the size of the buffer
                                 * at compile time so we have to allocate it.
        __u8 *spareBuffer;      /* For mtdif2 use. Don't know the size of the buffer
                                 * at compile time so we have to allocate it.
+
                                 */
        void (*putSuperFunc) (struct super_block *sb);
                                 */
        void (*putSuperFunc) (struct super_block *sb);
+        struct ylist_head searchContexts;
+
 #endif
 
        int isMounted;
 #endif
 
        int isMounted;
@@ -768,7 +769,9 @@ struct yaffs_DeviceStruct {
        /* yaffs2 runtime stuff */
        unsigned sequenceNumber;        /* Sequence number of currently allocating block */
        unsigned oldestDirtySequence;
        /* yaffs2 runtime stuff */
        unsigned sequenceNumber;        /* Sequence number of currently allocating block */
        unsigned oldestDirtySequence;
-
+       
+       /* Auto empty lost and found directory on mount */
+       int emptyLostAndFound;
 };
 
 typedef struct yaffs_DeviceStruct yaffs_Device;
 };
 
 typedef struct yaffs_DeviceStruct yaffs_Device;