diff options
author | Joe Thornber <ejt@redhat.com> | 2012-06-02 19:30:01 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2012-06-02 19:30:01 -0400 |
commit | cc8394d86f045b86ff303d3c9e4ce47d97148951 (patch) | |
tree | ad37143c9709f523fb2ca9fc5ac9de75e9a011f9 /drivers/md/persistent-data/dm-transaction-manager.c | |
parent | a24c25696b7133dd534d7a9436e576af79d9ce3b (diff) |
dm thin: provide userspace access to pool metadata
This patch implements two new messages that can be sent to the thin
pool target allowing it to take a snapshot of the _metadata_. This,
read-only snapshot can be accessed by userland, concurrently with the
live target.
Only one metadata snapshot can be held at a time. The pool's status
line will give the block location for the current msnap.
Since version 0.1.5 of the userland thin provisioning tools, the
thin_dump program displays the msnap as follows:
thin_dump -m <msnap root> <metadata dev>
Available here: https://github.com/jthornber/thin-provisioning-tools
Now that userland can access the metadata we can do various things
that have traditionally been kernel side tasks:
i) Incremental backups.
By using metadata snapshots we can work out what blocks have
changed over time. Combined with data snapshots we can ensure
the data doesn't change while we back it up.
A short proof of concept script can be found here:
https://github.com/jthornber/thinp-test-suite/blob/master/incremental_backup_example.rb
ii) Migration of thin devices from one pool to another.
iii) Merging snapshots back into an external origin.
iv) Asyncronous replication.
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/persistent-data/dm-transaction-manager.c')
-rw-r--r-- | drivers/md/persistent-data/dm-transaction-manager.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/persistent-data/dm-transaction-manager.c b/drivers/md/persistent-data/dm-transaction-manager.c index 6f8d38747d7f..400fe144c0cd 100644 --- a/drivers/md/persistent-data/dm-transaction-manager.c +++ b/drivers/md/persistent-data/dm-transaction-manager.c | |||
@@ -249,6 +249,7 @@ int dm_tm_shadow_block(struct dm_transaction_manager *tm, dm_block_t orig, | |||
249 | 249 | ||
250 | return r; | 250 | return r; |
251 | } | 251 | } |
252 | EXPORT_SYMBOL_GPL(dm_tm_shadow_block); | ||
252 | 253 | ||
253 | int dm_tm_read_lock(struct dm_transaction_manager *tm, dm_block_t b, | 254 | int dm_tm_read_lock(struct dm_transaction_manager *tm, dm_block_t b, |
254 | struct dm_block_validator *v, | 255 | struct dm_block_validator *v, |
@@ -259,6 +260,7 @@ int dm_tm_read_lock(struct dm_transaction_manager *tm, dm_block_t b, | |||
259 | 260 | ||
260 | return dm_bm_read_lock(tm->bm, b, v, blk); | 261 | return dm_bm_read_lock(tm->bm, b, v, blk); |
261 | } | 262 | } |
263 | EXPORT_SYMBOL_GPL(dm_tm_read_lock); | ||
262 | 264 | ||
263 | int dm_tm_unlock(struct dm_transaction_manager *tm, struct dm_block *b) | 265 | int dm_tm_unlock(struct dm_transaction_manager *tm, struct dm_block *b) |
264 | { | 266 | { |