summaryrefslogtreecommitdiffstats
path: root/drivers/md/md.h
diff options
context:
space:
mode:
authorNeilBrown2010-06-01 11:37:29 +0200
committerNeilBrown2010-07-26 04:53:08 +0200
commit2ac8740151b082f045e58010eb92560c3a23a0e9 (patch)
tree39bff686e28f033339c6d1cf47042b6dc1586c2f /drivers/md/md.h
parentmd/raid5: export is_congested test (diff)
downloadkernel-qcow2-linux-2ac8740151b082f045e58010eb92560c3a23a0e9.tar.gz
kernel-qcow2-linux-2ac8740151b082f045e58010eb92560c3a23a0e9.tar.xz
kernel-qcow2-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
*/