diff options
author | Joe Thornber <ejt@redhat.com> | 2012-07-27 10:08:10 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2012-07-27 10:08:10 -0400 |
commit | f9dd9352b92cd66729fcb0f0e32f647e811d9083 (patch) | |
tree | 64a68b82471961a8b9c71ffb4dd7391ea9af617d /drivers/md/dm-thin-metadata.c | |
parent | 332627db00a982b395f5b141d50298866bfec98c (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>
Diffstat (limited to 'drivers/md/dm-thin-metadata.c')
-rw-r--r-- | drivers/md/dm-thin-metadata.c | 15 |
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, | |||
535 | return r; | 535 | return r; |
536 | } | 536 | } |
537 | 537 | ||
538 | static void __destroy_persistent_data_objects(struct dm_pool_metadata *pmd) | ||
539 | { | ||
540 | dm_sm_destroy(pmd->data_sm); | ||
541 | dm_sm_destroy(pmd->metadata_sm); | ||
542 | dm_tm_destroy(pmd->nb_tm); | ||
543 | dm_tm_destroy(pmd->tm); | ||
544 | dm_block_manager_destroy(pmd->bm); | ||
545 | } | ||
546 | |||
538 | static int __begin_transaction(struct dm_pool_metadata *pmd) | 547 | static int __begin_transaction(struct dm_pool_metadata *pmd) |
539 | { | 548 | { |
540 | int r; | 549 | int r; |
@@ -792,11 +801,7 @@ int dm_pool_metadata_close(struct dm_pool_metadata *pmd) | |||
792 | DMWARN("%s: __commit_transaction() failed, error = %d", | 801 | DMWARN("%s: __commit_transaction() failed, error = %d", |
793 | __func__, r); | 802 | __func__, r); |
794 | 803 | ||
795 | dm_tm_destroy(pmd->tm); | 804 | __destroy_persistent_data_objects(pmd); |
796 | dm_tm_destroy(pmd->nb_tm); | ||
797 | dm_block_manager_destroy(pmd->bm); | ||
798 | dm_sm_destroy(pmd->metadata_sm); | ||
799 | dm_sm_destroy(pmd->data_sm); | ||
800 | kfree(pmd); | 805 | kfree(pmd); |
801 | 806 | ||
802 | return 0; | 807 | return 0; |