dm: add two stage requeue mechanism
[linux-2.6-microblaze.git] / drivers / md / dm-core.h
index 688aeba..8ef780a 100644 (file)
@@ -22,6 +22,8 @@
 
 #define DM_RESERVED_MAX_IOS            1024
 
+struct dm_io;
+
 struct dm_kobject_holder {
        struct kobject kobj;
        struct completion completion;
@@ -91,6 +93,14 @@ struct mapped_device {
        spinlock_t deferred_lock;
        struct bio_list deferred;
 
+       /*
+        * requeue work context is needed for cloning one new bio
+        * to represent the dm_io to be requeued, since each
+        * dm_io may point to the original bio from FS.
+        */
+       struct work_struct requeue_work;
+       struct dm_io *requeue_list;
+
        void *interface_ptr;
 
        /*
@@ -275,7 +285,6 @@ struct dm_io {
        atomic_t io_count;
        struct mapped_device *md;
 
-       struct bio *split_bio;
        /* The three fields represent mapped part of original bio */
        struct bio *orig_bio;
        unsigned int sector_offset; /* offset to end of orig_bio */
@@ -303,6 +312,8 @@ static inline void dm_io_set_flag(struct dm_io *io, unsigned int bit)
        io->flags |= (1U << bit);
 }
 
+void dm_io_rewind(struct dm_io *io, struct bio_set *bs);
+
 static inline struct completion *dm_get_completion_from_kobject(struct kobject *kobj)
 {
        return &container_of(kobj, struct dm_kobject_holder, kobj)->completion;
@@ -319,6 +330,4 @@ extern atomic_t dm_global_event_nr;
 extern wait_queue_head_t dm_global_eventq;
 void dm_issue_global_event(void);
 
-void dm_bio_rewind(struct bio *bio, unsigned bytes);
-
 #endif