diff options
author | Joe Thornber <ejt@redhat.com> | 2012-07-27 10:08:13 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2012-07-27 10:08:13 -0400 |
commit | 237074c0a30ac017faaf5c3dfab01aff0c6bb03a (patch) | |
tree | e980f9294638797fa8ef3412dd7036d56b19df1d | |
parent | a97e5e6fd027840fc28c72470c581ba68ee9732a (diff) |
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: 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.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c index 83ce2fde8ed7..e7b8ad78af47 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c | |||
@@ -596,9 +596,15 @@ bad: | |||
596 | } | 596 | } |
597 | 597 | ||
598 | static int __open_or_format_metadata(struct dm_pool_metadata *pmd, | 598 | static int __open_or_format_metadata(struct dm_pool_metadata *pmd, |
599 | int create) | 599 | int *create) |
600 | { | 600 | { |
601 | if (create) | 601 | int r; |
602 | |||
603 | r = __superblock_all_zeroes(pmd->bm, create); | ||
604 | if (r) | ||
605 | return r; | ||
606 | |||
607 | if (*create) | ||
602 | return __format_metadata(pmd); | 608 | return __format_metadata(pmd); |
603 | else | 609 | else |
604 | return __open_metadata(pmd); | 610 | return __open_metadata(pmd); |
@@ -617,13 +623,7 @@ static int __create_persistent_data_objects(struct dm_pool_metadata *pmd, | |||
617 | return PTR_ERR(pmd->bm); | 623 | return PTR_ERR(pmd->bm); |
618 | } | 624 | } |
619 | 625 | ||
620 | r = __superblock_all_zeroes(pmd->bm, create); | 626 | r = __open_or_format_metadata(pmd, create); |
621 | if (r) { | ||
622 | dm_block_manager_destroy(pmd->bm); | ||
623 | return r; | ||
624 | } | ||
625 | |||
626 | r = __open_or_format_metadata(pmd, *create); | ||
627 | if (r) | 627 | if (r) |
628 | dm_block_manager_destroy(pmd->bm); | 628 | dm_block_manager_destroy(pmd->bm); |
629 | 629 | ||