aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/dm-thin-metadata.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c
index 31d21bfc8cb4..83ce2fde8ed7 100644
--- a/drivers/md/dm-thin-metadata.c
+++ b/drivers/md/dm-thin-metadata.c
@@ -485,7 +485,7 @@ bad_locked:
485 return r; 485 return r;
486} 486}
487 487
488static int __format_metadata(struct dm_pool_metadata *pmd, dm_block_t nr_blocks) 488static int __format_metadata(struct dm_pool_metadata *pmd)
489{ 489{
490 int r; 490 int r;
491 491
@@ -496,7 +496,7 @@ static int __format_metadata(struct dm_pool_metadata *pmd, dm_block_t nr_blocks)
496 return r; 496 return r;
497 } 497 }
498 498
499 pmd->data_sm = dm_sm_disk_create(pmd->tm, nr_blocks); 499 pmd->data_sm = dm_sm_disk_create(pmd->tm, 0);
500 if (IS_ERR(pmd->data_sm)) { 500 if (IS_ERR(pmd->data_sm)) {
501 DMERR("sm_disk_create failed"); 501 DMERR("sm_disk_create failed");
502 r = PTR_ERR(pmd->data_sm); 502 r = PTR_ERR(pmd->data_sm);
@@ -596,16 +596,16 @@ bad:
596} 596}
597 597
598static int __open_or_format_metadata(struct dm_pool_metadata *pmd, 598static int __open_or_format_metadata(struct dm_pool_metadata *pmd,
599 dm_block_t nr_blocks, int create) 599 int create)
600{ 600{
601 if (create) 601 if (create)
602 return __format_metadata(pmd, nr_blocks); 602 return __format_metadata(pmd);
603 else 603 else
604 return __open_metadata(pmd); 604 return __open_metadata(pmd);
605} 605}
606 606
607static int __create_persistent_data_objects(struct dm_pool_metadata *pmd, 607static int __create_persistent_data_objects(struct dm_pool_metadata *pmd,
608 dm_block_t nr_blocks, int *create) 608 int *create)
609{ 609{
610 int r; 610 int r;
611 611
@@ -623,7 +623,7 @@ static int __create_persistent_data_objects(struct dm_pool_metadata *pmd,
623 return r; 623 return r;
624 } 624 }
625 625
626 r = __open_or_format_metadata(pmd, nr_blocks, *create); 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
@@ -808,7 +808,7 @@ struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev,
808 pmd->bdev = bdev; 808 pmd->bdev = bdev;
809 pmd->data_block_size = data_block_size; 809 pmd->data_block_size = data_block_size;
810 810
811 r = __create_persistent_data_objects(pmd, 0, &create); 811 r = __create_persistent_data_objects(pmd, &create);
812 if (r) { 812 if (r) {
813 kfree(pmd); 813 kfree(pmd);
814 return ERR_PTR(r); 814 return ERR_PTR(r);