提交 f9dd9352 编写于 作者: J Joe Thornber 提交者: Alasdair G Kergon

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: NJoe Thornber <ejt@redhat.com>
Signed-off-by: NMike Snitzer <snitzer@redhat.com>
Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
上级 332627db
...@@ -535,6 +535,15 @@ static int __create_persistent_data_objects(struct dm_pool_metadata *pmd, ...@@ -535,6 +535,15 @@ static int __create_persistent_data_objects(struct dm_pool_metadata *pmd,
return r; 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) static int __begin_transaction(struct dm_pool_metadata *pmd)
{ {
int r; int r;
...@@ -792,11 +801,7 @@ int dm_pool_metadata_close(struct dm_pool_metadata *pmd) ...@@ -792,11 +801,7 @@ int dm_pool_metadata_close(struct dm_pool_metadata *pmd)
DMWARN("%s: __commit_transaction() failed, error = %d", DMWARN("%s: __commit_transaction() failed, error = %d",
__func__, r); __func__, r);
dm_tm_destroy(pmd->tm); __destroy_persistent_data_objects(pmd);
dm_tm_destroy(pmd->nb_tm);
dm_block_manager_destroy(pmd->bm);
dm_sm_destroy(pmd->metadata_sm);
dm_sm_destroy(pmd->data_sm);
kfree(pmd); kfree(pmd);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册