New fix for readdir hang
[yaffs2.git] / yaffs_guts.h
index f47c65edda47f8362c2569b4de74e8a7782438da..c58c84bf1f29962c1fcc74ab7596e7942a35330f 100644 (file)
@@ -599,8 +599,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);
 
@@ -640,10 +641,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;