summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2012-07-27 15:08:10 +0100
committerAlasdair G Kergon <agk@redhat.com>2012-07-27 15:08:10 +0100
commitf9dd9352b92cd66729fcb0f0e32f647e811d9083 (patch)
tree64a68b82471961a8b9c71ffb4dd7391ea9af617d
parent332627db00a982b395f5b141d50298866bfec98c (diff)
dm thin metadata: factor __destroy_persistent_data out of dm_pool_metadata_close
Factor __destroy_persistent_data_objects out of dm_pool_metadata_close. Signed-off-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
-rw-r--r--drivers/md/dm-thin-metadata.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c
index dab2109ec40a..b646a71f6da9 100644
--- a/drivers/md/dm-thin-metadata.c
+++ b/drivers/md/dm-thin-metadata.c
@@ -535,6 +535,15 @@ static int __create_persistent_data_objects(struct dm_pool_metadata *pmd,
return r;
}
+static void __destroy_persistent_data_objects(struct dm_pool_metadata *pmd)
+{
+ dm_sm_destroy(pmd->data_sm);
+ dm_sm_destroy(pmd->metadata_sm);
+ dm_tm_destroy(pmd->nb_tm);
+ dm_tm_destroy(pmd->tm);
+ dm_block_manager_destroy(pmd->bm);
+}
+
static int __begin_transaction(struct dm_pool_metadata *pmd)
{
int r;
@@ -792,11 +801,7 @@ int dm_pool_metadata_close(struct dm_pool_metadata *pmd)
DMWARN("%s: __commit_transaction() failed, error = %d",
__func__, r);
- dm_tm_destroy(pmd->tm);
- dm_tm_destroy(pmd->nb_tm);
- dm_block_manager_destroy(pmd->bm);
- dm_sm_destroy(pmd->metadata_sm);
- dm_sm_destroy(pmd->data_sm);
+ __destroy_persistent_data_objects(pmd);
kfree(pmd);
return 0;