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

dm thin metadata: move __superblock_all_zeroes to __open_or_format_metadata

Move the check for __superblock_all_zeroes from
__create_persistent_data_objects() down to __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>
上级 a97e5e6f
......@@ -596,9 +596,15 @@ static int __open_metadata(struct dm_pool_metadata *pmd)
}
static int __open_or_format_metadata(struct dm_pool_metadata *pmd,
int create)
int *create)
{
if (create)
int r;
r = __superblock_all_zeroes(pmd->bm, create);
if (r)
return r;
if (*create)
return __format_metadata(pmd);
else
return __open_metadata(pmd);
......@@ -617,13 +623,7 @@ static int __create_persistent_data_objects(struct dm_pool_metadata *pmd,
return PTR_ERR(pmd->bm);
}
r = __superblock_all_zeroes(pmd->bm, create);
if (r) {
dm_block_manager_destroy(pmd->bm);
return r;
}
r = __open_or_format_metadata(pmd, *create);
r = __open_or_format_metadata(pmd, create);
if (r)
dm_block_manager_destroy(pmd->bm);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册