diff options
author | Joe Thornber <ejt@redhat.com> | 2012-07-27 10:08:10 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2012-07-27 10:08:10 -0400 |
commit | 6a0ebd31b6b504621254f5d453d618d36b0179a1 (patch) | |
tree | 2c9620617b5302d0ab7432112e0be5f0918de7f6 /drivers/md/dm-thin-metadata.c | |
parent | f9dd9352b92cd66729fcb0f0e32f647e811d9083 (diff) |
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: 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 | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c index b646a71f6da9..ce487aada0d8 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c | |||
@@ -489,14 +489,11 @@ static int __open_or_format_metadata(struct dm_pool_metadata *pmd, | |||
489 | } | 489 | } |
490 | 490 | ||
491 | __setup_btree_details(pmd); | 491 | __setup_btree_details(pmd); |
492 | pmd->root = 0; | ||
493 | 492 | ||
494 | init_rwsem(&pmd->root_lock); | 493 | pmd->root = 0; |
495 | pmd->time = 0; | ||
496 | pmd->details_root = 0; | 494 | pmd->details_root = 0; |
497 | pmd->trans_id = 0; | 495 | pmd->trans_id = 0; |
498 | pmd->flags = 0; | 496 | pmd->flags = 0; |
499 | INIT_LIST_HEAD(&pmd->thin_devices); | ||
500 | 497 | ||
501 | return 0; | 498 | return 0; |
502 | 499 | ||
@@ -710,6 +707,9 @@ struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev, | |||
710 | return ERR_PTR(-ENOMEM); | 707 | return ERR_PTR(-ENOMEM); |
711 | } | 708 | } |
712 | 709 | ||
710 | init_rwsem(&pmd->root_lock); | ||
711 | pmd->time = 0; | ||
712 | INIT_LIST_HEAD(&pmd->thin_devices); | ||
713 | pmd->bdev = bdev; | 713 | pmd->bdev = bdev; |
714 | 714 | ||
715 | r = __create_persistent_data_objects(pmd, 0, &create); | 715 | r = __create_persistent_data_objects(pmd, 0, &create); |