vserver 1.9.5.x5
[linux-2.6.git] / include / linux / jffs2_fs_sb.h
index ee80d25..4afc8d8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: jffs2_fs_sb.h,v 1.45 2003/10/08 11:46:27 dwmw2 Exp $ */
+/* $Id: jffs2_fs_sb.h,v 1.48 2004/11/20 10:41:12 dwmw2 Exp $ */
 
 #ifndef _JFFS2_FS_SB
 #define _JFFS2_FS_SB
@@ -11,6 +11,7 @@
 #include <linux/timer.h>
 #include <linux/wait.h>
 #include <linux/list.h>
+#include <linux/rwsem.h>
 
 #define JFFS2_SB_FLAG_RO 1
 #define JFFS2_SB_FLAG_MOUNTING 2
@@ -35,9 +36,7 @@ struct jffs2_sb_info {
 
        struct semaphore alloc_sem;     /* Used to protect all the following 
                                           fields, and also to protect against
-                                          out-of-order writing of nodes.
-                                          And GC.
-                                       */
+                                          out-of-order writing of nodes. And GC. */
        uint32_t cleanmarker_size;      /* Size of an _inline_ CLEANMARKER
                                         (i.e. zero for OOB CLEANMARKER */
 
@@ -95,7 +94,7 @@ struct jffs2_sb_info {
           to an obsoleted node. I don't like this. Alternatives welcomed. */
        struct semaphore erase_free_sem;
 
-#ifdef CONFIG_JFFS2_FS_NAND
+#if defined CONFIG_JFFS2_FS_NAND || defined CONFIG_JFFS2_FS_NOR_ECC
        /* Write-behind buffer for NAND flash */
        unsigned char *wbuf;
        uint32_t wbuf_ofs;
@@ -103,6 +102,8 @@ struct jffs2_sb_info {
        uint32_t wbuf_pagesize;
        struct jffs2_inodirty *wbuf_inodes;
 
+       struct rw_semaphore wbuf_sem;   /* Protects the write buffer */
+
        /* Information about out-of-band area usage... */
        struct nand_oobinfo *oobinfo;
        uint32_t badblock_pos;