aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-exception-store.h
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2009-12-10 18:52:12 -0500
committerAlasdair G Kergon <agk@redhat.com>2009-12-10 18:52:12 -0500
commitfc56f6fbcca3672c63c93c65f45105faacfc13cb (patch)
treef50f42a461ef33f8617fbdb781879e6ae77b62c4 /drivers/md/dm-exception-store.h
parent985903bb3a6d98623360ab6c855417f638840029 (diff)
dm snapshot: move cow ref from exception store to snap core
Store the reference to the snapshot cow device in the core snapshot code instead of each exception store. It can be accessed through the new function dm_snap_cow(). Exception stores should each now maintain a reference to their parent snapshot struct. This is cleaner and makes part of the forthcoming snapshot merge code simpler. Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Reviewed-by: Jonathan Brassow <jbrassow@redhat.com> Cc: Mikulas Patocka <mpatocka@redhat.com>
Diffstat (limited to 'drivers/md/dm-exception-store.h')
-rw-r--r--drivers/md/dm-exception-store.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/md/dm-exception-store.h b/drivers/md/dm-exception-store.h
index 366c8b1fca37..bb8874653de1 100644
--- a/drivers/md/dm-exception-store.h
+++ b/drivers/md/dm-exception-store.h
@@ -94,11 +94,11 @@ struct dm_exception_store_type {
94 struct list_head list; 94 struct list_head list;
95}; 95};
96 96
97struct dm_snapshot;
98
97struct dm_exception_store { 99struct dm_exception_store {
98 struct dm_exception_store_type *type; 100 struct dm_exception_store_type *type;
99 struct dm_target *ti; 101 struct dm_snapshot *snap;
100
101 struct dm_dev *cow;
102 102
103 /* Size of data blocks saved - must be a power of 2 */ 103 /* Size of data blocks saved - must be a power of 2 */
104 unsigned chunk_size; 104 unsigned chunk_size;
@@ -109,6 +109,11 @@ struct dm_exception_store {
109}; 109};
110 110
111/* 111/*
112 * Obtain the cow device used by a given snapshot.
113 */
114struct dm_dev *dm_snap_cow(struct dm_snapshot *snap);
115
116/*
112 * Funtions to manipulate consecutive chunks 117 * Funtions to manipulate consecutive chunks
113 */ 118 */
114# if defined(CONFIG_LBDAF) || (BITS_PER_LONG == 64) 119# if defined(CONFIG_LBDAF) || (BITS_PER_LONG == 64)
@@ -173,6 +178,7 @@ int dm_exception_store_set_chunk_size(struct dm_exception_store *store,
173 char **error); 178 char **error);
174 179
175int dm_exception_store_create(struct dm_target *ti, int argc, char **argv, 180int dm_exception_store_create(struct dm_target *ti, int argc, char **argv,
181 struct dm_snapshot *snap,
176 unsigned *args_used, 182 unsigned *args_used,
177 struct dm_exception_store **store); 183 struct dm_exception_store **store);
178void dm_exception_store_destroy(struct dm_exception_store *store); 184void dm_exception_store_destroy(struct dm_exception_store *store);