]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/block/drbd/drbd_int.h
drbd: Add read_requests tree
[mirror_ubuntu-artful-kernel.git] / drivers / block / drbd / drbd_int.h
index ef2ceed3be4b2767f6b3886a48a002609597e2e8..46a4332d34411c0b25ac8c5cf66987a58571b70c 100644 (file)
@@ -87,17 +87,10 @@ extern char usermode_helper[];
  */
 #define DRBD_SIGKILL SIGHUP
 
-/* All EEs on the free list should have ID_VACANT (== 0)
- * freshly allocated EEs get !ID_VACANT (== 1)
- * so if it says "cannot dereference null pointer at address 0x00000001",
- * it is most likely one of these :( */
-
 #define ID_IN_SYNC      (4711ULL)
 #define ID_OUT_OF_SYNC  (4712ULL)
-
 #define ID_SYNCER (-1ULL)
-#define ID_VACANT 0
-#define is_syncer_block_id(id) ((id) == ID_SYNCER)
+
 #define UUID_NEW_BM_OFFSET ((u64)0x0001000000000000ULL)
 
 struct drbd_conf;
@@ -689,7 +682,8 @@ struct drbd_work {
        drbd_work_cb cb;
 };
 
-struct drbd_tl_epoch;
+#include "drbd_interval.h"
+
 struct drbd_request {
        struct drbd_work w;
        struct drbd_conf *mdev;
@@ -701,8 +695,7 @@ struct drbd_request {
        struct bio *private_bio;
 
        struct hlist_node collision;
-       sector_t sector;
-       unsigned int size;
+       struct drbd_interval i;
        unsigned int epoch; /* barrier_nr */
 
        /* barrier_nr: used to check on "completion" whether this req was in
@@ -1026,6 +1019,10 @@ struct drbd_conf {
        struct hlist_head *tl_hash;
        unsigned int tl_hash_s;
 
+       /* Interval tree of pending local requests */
+       struct rb_root read_requests;
+       struct rb_root write_requests;
+
        /* blocks to resync in this run [unit BM_BLOCK_SIZE] */
        unsigned long rs_total;
        /* number of resync blocks that failed in this run */
@@ -1600,7 +1597,6 @@ extern void _drbd_wait_ee_list_empty(struct drbd_conf *mdev,
 extern void drbd_set_recv_tcq(struct drbd_conf *mdev, int tcq_enabled);
 extern void _drbd_clear_done_ee(struct drbd_conf *mdev, struct list_head *to_be_freed);
 extern void drbd_flush_workqueue(struct drbd_conf *mdev);
-extern void drbd_free_tl_hash(struct drbd_conf *mdev);
 
 /* yes, there is kernel_setsockopt, but only since 2.6.18. we don't need to
  * mess with get_fs/set_fs, we know we are KERNEL_DS always. */