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

dm thin metadata: lift some initialisation out of __open_or_format_metadata

Lift some initialisation out of __open_or_format_metadata in dm-thin-metadata.
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>
上级 f9dd9352
......@@ -489,14 +489,11 @@ static int __open_or_format_metadata(struct dm_pool_metadata *pmd,
}
__setup_btree_details(pmd);
pmd->root = 0;
init_rwsem(&pmd->root_lock);
pmd->time = 0;
pmd->root = 0;
pmd->details_root = 0;
pmd->trans_id = 0;
pmd->flags = 0;
INIT_LIST_HEAD(&pmd->thin_devices);
return 0;
......@@ -710,6 +707,9 @@ struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev,
return ERR_PTR(-ENOMEM);
}
init_rwsem(&pmd->root_lock);
pmd->time = 0;
INIT_LIST_HEAD(&pmd->thin_devices);
pmd->bdev = bdev;
r = __create_persistent_data_objects(pmd, 0, &create);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册