X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmd%2Fdm-snap.h;h=15fa2ae6cdc2971f590a814578d06536b75b8484;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=375aa24d4d7d88ee8e2b7fb437108db19349e916;hpb=5fc42a6ed0ec81088c37caadb45898ae6cd0ad2c;p=linux-2.6.git diff --git a/drivers/md/dm-snap.h b/drivers/md/dm-snap.h index 375aa24d4..15fa2ae6c 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 +#include struct exception_table { uint32_t hash_mask; @@ -99,7 +101,9 @@ struct dm_snapshot { /* You can't use a snapshot if this is 0 (e.g. if full) */ int valid; - int have_metadata; + + /* Origin writes don't trigger exceptions until this is set */ + int active; /* Used for display of table */ char type; @@ -110,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; }; /* @@ -126,10 +140,9 @@ int dm_add_exception(struct dm_snapshot *s, chunk_t old, chunk_t new); * Constructor and destructor for the default persistent * store. */ -int dm_create_persistent(struct exception_store *store, uint32_t chunk_size); +int dm_create_persistent(struct exception_store *store); -int dm_create_transient(struct exception_store *store, - struct dm_snapshot *s, int blocksize); +int dm_create_transient(struct exception_store *store); /* * Return the number of sectors in the device.