diff options
author | Joe Thornber <ejt@redhat.com> | 2013-05-10 14:37:19 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2013-05-10 14:37:19 +0100 |
commit | 24347e9595704464f62a4ed8f46abf62b4c79cdd (patch) | |
tree | d522f4239193edda8bb204d2c0b4251f2e982bbb /drivers/md/dm-thin-metadata.c | |
parent | 1921c56d95c4ac92b359ad44ffbc1e9a36060b29 (diff) | |
download | blackbird-op-linux-24347e9595704464f62a4ed8f46abf62b4c79cdd.tar.gz blackbird-op-linux-24347e9595704464f62a4ed8f46abf62b4c79cdd.zip |
dm thin: detect metadata device resizing
Allow the dm thin pool metadata device to be extended.
Whenever a pool is resumed, detect whether the size of the metadata
device has increased, and if so, extend the metadata to use the new
space.
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-thin-metadata.c')
-rw-r--r-- | drivers/md/dm-thin-metadata.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c index 9452a489ed99..f553ed66603c 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c @@ -1677,6 +1677,18 @@ int dm_pool_resize_data_dev(struct dm_pool_metadata *pmd, dm_block_t new_count) return r; } +int dm_pool_resize_metadata_dev(struct dm_pool_metadata *pmd, dm_block_t new_count) +{ + int r = -EINVAL; + + down_write(&pmd->root_lock); + if (!pmd->fail_io) + r = __resize_space_map(pmd->metadata_sm, new_count); + up_write(&pmd->root_lock); + + return r; +} + void dm_pool_metadata_read_only(struct dm_pool_metadata *pmd) { down_write(&pmd->root_lock); |