summaryrefslogtreecommitdiffstats
path: root/drivers/md/md.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-06-01 19:37:29 +1000
committerNeilBrown <neilb@suse.de>2010-07-26 12:53:08 +1000
commit2ac8740151b082f045e58010eb92560c3a23a0e9 (patch)
tree39bff686e28f033339c6d1cf47042b6dc1586c2f /drivers/md/md.h
parent11d8a6e3719519fbc0e2c9d61b6fa931b84bf813 (diff)
downloadblackbird-op-linux-2ac8740151b082f045e58010eb92560c3a23a0e9.tar.gz
blackbird-op-linux-2ac8740151b082f045e58010eb92560c3a23a0e9.zip
md/raid5: add simple plugging infrastructure.
md/raid5 uses the plugging infrastructure provided by the block layer and 'struct request_queue'. However when we plug raid5 under dm there is no request queue so we cannot use that. So create a similar infrastructure that is much lighter weight and use it for raid5. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r--drivers/md/md.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h
index c88b04745e85..5be0d6921b9d 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -29,6 +29,26 @@
typedef struct mddev_s mddev_t;
typedef struct mdk_rdev_s mdk_rdev_t;
+/* generic plugging support - like that provided with request_queue,
+ * but does not require a request_queue
+ */
+struct plug_handle {
+ void (*unplug_fn)(struct plug_handle *);
+ struct timer_list unplug_timer;
+ struct work_struct unplug_work;
+ unsigned long unplug_flag;
+};
+#define PLUGGED_FLAG 1
+void plugger_init(struct plug_handle *plug,
+ void (*unplug_fn)(struct plug_handle *));
+void plugger_set_plug(struct plug_handle *plug);
+int plugger_remove_plug(struct plug_handle *plug);
+static inline void plugger_flush(struct plug_handle *plug)
+{
+ del_timer_sync(&plug->unplug_timer);
+ cancel_work_sync(&plug->unplug_work);
+}
+
/*
* MD's 'extended' device
*/
OpenPOWER on IntegriCloud