[PATCH] md: new sysfs interface for setting bits in the write-intent-bitmap
[sfrench/cifs-2.6.git] / include / linux / raid / bitmap.h
index 9de99198caf10a353a69e8a9fef32ed3c9d8c36d..84d88775185556e4d2a8a6b0560bcfc9c202038a 100644 (file)
@@ -6,7 +6,13 @@
 #ifndef BITMAP_H
 #define BITMAP_H 1
 
-#define BITMAP_MAJOR 3
+#define BITMAP_MAJOR_LO 3
+/* version 4 insists the bitmap is in little-endian order
+ * with version 3, it is host-endian which is non-portable
+ */
+#define BITMAP_MAJOR_HI 4
+#define        BITMAP_MAJOR_HOSTENDIAN 3
+
 #define BITMAP_MINOR 39
 
 /*
@@ -133,7 +139,9 @@ typedef __u16 bitmap_counter_t;
 /* use these for bitmap->flags and bitmap->sb->state bit-fields */
 enum bitmap_state {
        BITMAP_ACTIVE = 0x001, /* the bitmap is in use */
-       BITMAP_STALE  = 0x002  /* the bitmap file is out of date or had -EIO */
+       BITMAP_STALE  = 0x002,  /* the bitmap file is out of date or had -EIO */
+       BITMAP_WRITE_ERROR = 0x004, /* A write error has occurred */
+       BITMAP_HOSTENDIAN = 0x8000,
 };
 
 /* the superblock at the front of the bitmap file -- little endian */
@@ -237,15 +245,9 @@ struct bitmap {
        unsigned long daemon_lastrun; /* jiffies of last run */
        unsigned long daemon_sleep; /* how many seconds between updates? */
 
-       /*
-        * 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;
+       atomic_t pending_writes; /* pending writes to the bitmap file */
        wait_queue_head_t write_wait;
-       struct list_head complete_pages;
-       mempool_t *write_pool;
+
 };
 
 /* the bitmap API */
@@ -263,6 +265,8 @@ int bitmap_update_sb(struct bitmap *bitmap);
 int  bitmap_setallbits(struct bitmap *bitmap);
 void bitmap_write_all(struct bitmap *bitmap);
 
+void bitmap_dirty_bits(struct bitmap *bitmap, unsigned long s, unsigned long e);
+
 /* these are exported */
 int bitmap_startwrite(struct bitmap *bitmap, sector_t offset,
                        unsigned long sectors, int behind);