diff options
author | Alasdair G Kergon <agk@redhat.com> | 2006-10-03 04:15:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-03 11:04:14 -0400 |
commit | ca3a931fd33b841cbcc5932f8eac7c43e0909242 (patch) | |
tree | bc8aa7ace1a5e528cbfabc01b17a2016c55bc448 /drivers/md/dm-snap.h | |
parent | 9d493fa8c943ed4ec6e42b7ebfd8f0b7657d54f8 (diff) |
[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.h | 12 |
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 @@ | |||
10 | #define DM_SNAPSHOT_H | 10 | #define DM_SNAPSHOT_H |
11 | 11 | ||
12 | #include "dm.h" | 12 | #include "dm.h" |
13 | #include "dm-bio-list.h" | ||
13 | #include <linux/blkdev.h> | 14 | #include <linux/blkdev.h> |
15 | #include <linux/workqueue.h> | ||
14 | 16 | ||
15 | struct exception_table { | 17 | struct exception_table { |
16 | uint32_t hash_mask; | 18 | uint32_t hash_mask; |
@@ -112,10 +114,20 @@ struct dm_snapshot { | |||
112 | struct exception_table pending; | 114 | struct exception_table pending; |
113 | struct exception_table complete; | 115 | struct exception_table complete; |
114 | 116 | ||
117 | /* | ||
118 | * pe_lock protects all pending_exception operations and access | ||
119 | * as well as the snapshot_bios list. | ||
120 | */ | ||
121 | spinlock_t pe_lock; | ||
122 | |||
115 | /* The on disk metadata handler */ | 123 | /* The on disk metadata handler */ |
116 | struct exception_store store; | 124 | struct exception_store store; |
117 | 125 | ||
118 | struct kcopyd_client *kcopyd_client; | 126 | struct kcopyd_client *kcopyd_client; |
127 | |||
128 | /* Queue of snapshot writes for ksnapd to flush */ | ||
129 | struct bio_list queued_bios; | ||
130 | struct work_struct queued_bios_work; | ||
119 | }; | 131 | }; |
120 | 132 | ||
121 | /* | 133 | /* |