summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-snap.h
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2006-10-03 10:15:30 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 17:04:14 +0200
commitca3a931fd33b841cbcc5932f8eac7c43e0909242 (patch)
treebc8aa7ace1a5e528cbfabc01b17a2016c55bc448 /drivers/md/dm-snap.h
parent[PATCH] dm snapshot: tidy pending_complete (diff)
downloadlinux-ca3a931fd33b841cbcc5932f8eac7c43e0909242.tar.xz
linux-ca3a931fd33b841cbcc5932f8eac7c43e0909242.zip
[PATCH] dm snapshot: add workqueue
Add a workqueue so that I/O can be queued up to be flushed from a separate thread (e.g. if local interrupts are disabled). A new per-snapshot spinlock pe_lock is introduced to protect queued_bios. Signed-off-by: Alasdair G Kergon <agk@redhat.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/dm-snap.h')
-rw-r--r--drivers/md/dm-snap.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/md/dm-snap.h b/drivers/md/dm-snap.h
index 221eb8880c80..15fa2ae6cdc2 100644
--- a/drivers/md/dm-snap.h
+++ b/drivers/md/dm-snap.h
@@ -10,7 +10,9 @@
#define DM_SNAPSHOT_H
#include "dm.h"
+#include "dm-bio-list.h"
#include <linux/blkdev.h>
+#include <linux/workqueue.h>
struct exception_table {
uint32_t hash_mask;
@@ -112,10 +114,20 @@ struct dm_snapshot {
struct exception_table pending;
struct exception_table complete;
+ /*
+ * pe_lock protects all pending_exception operations and access
+ * as well as the snapshot_bios list.
+ */
+ spinlock_t pe_lock;
+
/* The on disk metadata handler */
struct exception_store store;
struct kcopyd_client *kcopyd_client;
+
+ /* Queue of snapshot writes for ksnapd to flush */
+ struct bio_list queued_bios;
+ struct work_struct queued_bios_work;
};
/*