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 | 8801e06945b6fec9927d5f7a04890a20061340c2 (patch) | |
tree | 5c21ddcc622ff3dbd1a9173b2d8f66ba119db272 /drivers/md/dm-thin-metadata.c | |
parent | 237074c0a30ac017faaf5c3dfab01aff0c6bb03a (diff) |
dm thin metadata: remove create parameter from __create_persistent_data_objects
Remove 'create' parameter from __create_persistent_data_objects() 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>
Diffstat (limited to 'drivers/md/dm-thin-metadata.c')
-rw-r--r-- | drivers/md/dm-thin-metadata.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c index e7b8ad78af47..7317f1b4ab15 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c | |||
@@ -595,23 +595,21 @@ bad: | |||
595 | return r; | 595 | return r; |
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) | ||
600 | { | 599 | { |
601 | int r; | 600 | int r, unformatted; |
602 | 601 | ||
603 | r = __superblock_all_zeroes(pmd->bm, create); | 602 | r = __superblock_all_zeroes(pmd->bm, &unformatted); |
604 | if (r) | 603 | if (r) |
605 | return r; | 604 | return r; |
606 | 605 | ||
607 | if (*create) | 606 | if (unformatted) |
608 | return __format_metadata(pmd); | 607 | return __format_metadata(pmd); |
609 | else | 608 | else |
610 | return __open_metadata(pmd); | 609 | return __open_metadata(pmd); |
611 | } | 610 | } |
612 | 611 | ||
613 | static int __create_persistent_data_objects(struct dm_pool_metadata *pmd, | 612 | static int __create_persistent_data_objects(struct dm_pool_metadata *pmd) |
614 | int *create) | ||
615 | { | 613 | { |
616 | int r; | 614 | int r; |
617 | 615 | ||
@@ -623,7 +621,7 @@ static int __create_persistent_data_objects(struct dm_pool_metadata *pmd, | |||
623 | return PTR_ERR(pmd->bm); | 621 | return PTR_ERR(pmd->bm); |
624 | } | 622 | } |
625 | 623 | ||
626 | r = __open_or_format_metadata(pmd, create); | 624 | r = __open_or_format_metadata(pmd); |
627 | if (r) | 625 | if (r) |
628 | dm_block_manager_destroy(pmd->bm); | 626 | dm_block_manager_destroy(pmd->bm); |
629 | 627 | ||
@@ -794,7 +792,6 @@ struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev, | |||
794 | { | 792 | { |
795 | int r; | 793 | int r; |
796 | struct dm_pool_metadata *pmd; | 794 | struct dm_pool_metadata *pmd; |
797 | int create; | ||
798 | 795 | ||
799 | pmd = kmalloc(sizeof(*pmd), GFP_KERNEL); | 796 | pmd = kmalloc(sizeof(*pmd), GFP_KERNEL); |
800 | if (!pmd) { | 797 | if (!pmd) { |
@@ -808,7 +805,7 @@ struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev, | |||
808 | pmd->bdev = bdev; | 805 | pmd->bdev = bdev; |
809 | pmd->data_block_size = data_block_size; | 806 | pmd->data_block_size = data_block_size; |
810 | 807 | ||
811 | r = __create_persistent_data_objects(pmd, &create); | 808 | r = __create_persistent_data_objects(pmd); |
812 | if (r) { | 809 | if (r) { |
813 | kfree(pmd); | 810 | kfree(pmd); |
814 | return ERR_PTR(r); | 811 | return ERR_PTR(r); |