Merge master.kernel.org:/home/rmk/linux-2.6-arm
[pandora-kernel.git] / include / linux / raid / bitmap.h
index f785cf2..9de9919 100644 (file)
@@ -7,7 +7,7 @@
 #define BITMAP_H 1
 
 #define BITMAP_MAJOR 3
-#define BITMAP_MINOR 38
+#define BITMAP_MINOR 39
 
 /*
  * in-memory bitmap:
@@ -147,8 +147,9 @@ typedef struct bitmap_super_s {
        __u32 state;        /* 48  bitmap state information */
        __u32 chunksize;    /* 52  the bitmap chunk size in bytes */
        __u32 daemon_sleep; /* 56  seconds between disk flushes */
+       __u32 write_behind; /* 60  number of outstanding write-behind writes */
 
-       __u8  pad[256 - 60]; /* set to zero */
+       __u8  pad[256 - 64]; /* set to zero */
 } bitmap_super_t;
 
 /* notes:
@@ -217,6 +218,7 @@ struct bitmap {
        /* bitmap spinlock */
        spinlock_t lock;
 
+       long offset; /* offset from superblock if file is NULL */
        struct file *file; /* backing disk file */
        struct page *sb_page; /* cached copy of the bitmap file superblock */
        struct page **filemap; /* list of cache pages for the file */
@@ -225,6 +227,9 @@ struct bitmap {
 
        unsigned long flags;
 
+       unsigned long max_write_behind; /* write-behind mode */
+       atomic_t behind_writes;
+
        /*
         * the bitmap daemon - periodically wakes up and sweeps the bitmap
         * file, cleaning up bits and flushing out pages to disk as necessary
@@ -233,21 +238,12 @@ struct bitmap {
        unsigned long daemon_sleep; /* how many seconds between updates? */
 
        /*
-        * bitmap write daemon - this daemon performs writes to the bitmap file
-        * this thread is only needed because of a limitation in ext3 (jbd)
-        * that does not allow a task to have two journal transactions ongoing
-        * simultaneously (even if the transactions are for two different
-        * filesystems) -- in the case of bitmap, that would be the filesystem
-        * that the bitmap file resides on and the filesystem that is mounted
-        * on the md device -- see current->journal_info in jbd/transaction.c
+        * bitmap_writeback_daemon waits for file-pages that have been written,
+        * as there is no way to get a call-back when a page write completes.
         */
        mdk_thread_t *writeback_daemon;
        spinlock_t write_lock;
-       struct semaphore write_ready;
-       struct semaphore write_done;
-       unsigned long writes_pending;
        wait_queue_head_t write_wait;
-       struct list_head write_pages;
        struct list_head complete_pages;
        mempool_t *write_pool;
 };
@@ -256,6 +252,7 @@ struct bitmap {
 
 /* these are used only by md/bitmap */
 int  bitmap_create(mddev_t *mddev);
+void bitmap_flush(mddev_t *mddev);
 void bitmap_destroy(mddev_t *mddev);
 int  bitmap_active(struct bitmap *bitmap);
 
@@ -264,12 +261,14 @@ void bitmap_print_sb(struct bitmap *bitmap);
 int bitmap_update_sb(struct bitmap *bitmap);
 
 int  bitmap_setallbits(struct bitmap *bitmap);
+void bitmap_write_all(struct bitmap *bitmap);
 
 /* these are exported */
-int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors);
-void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors,
-                    int success);
-int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks);
+int bitmap_startwrite(struct bitmap *bitmap, sector_t offset,
+                       unsigned long sectors, int behind);
+void bitmap_endwrite(struct bitmap *bitmap, sector_t offset,
+                       unsigned long sectors, int success, int behind);
+int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded);
 void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted);
 void bitmap_close_sync(struct bitmap *bitmap);