[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>
This commit is contained in:

committed by
Linus Torvalds

父節點
9d493fa8c9
當前提交
ca3a931fd3
@@ -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;
|
||||
};
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user