summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-thin-metadata.c
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2012-07-27 15:08:10 +0100
committerAlasdair G Kergon <agk@redhat.com>2012-07-27 15:08:10 +0100
commit6a0ebd31b6b504621254f5d453d618d36b0179a1 (patch)
tree2c9620617b5302d0ab7432112e0be5f0918de7f6 /drivers/md/dm-thin-metadata.c
parentf9dd9352b92cd66729fcb0f0e32f647e811d9083 (diff)
downloadblackbird-op-linux-6a0ebd31b6b504621254f5d453d618d36b0179a1.tar.gz
blackbird-op-linux-6a0ebd31b6b504621254f5d453d618d36b0179a1.zip
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.c8
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,
}
__setup_btree_details(pmd);
- pmd->root = 0;
- init_rwsem(&pmd->root_lock);
- pmd->time = 0;
+ pmd->root = 0;
pmd->details_root = 0;
pmd->trans_id = 0;
pmd->flags = 0;
- INIT_LIST_HEAD(&pmd->thin_devices);
return 0;
@@ -710,6 +707,9 @@ struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev,
return ERR_PTR(-ENOMEM);
}
+ init_rwsem(&pmd->root_lock);
+ pmd->time = 0;
+ INIT_LIST_HEAD(&pmd->thin_devices);
pmd->bdev = bdev;
r = __create_persistent_data_objects(pmd, 0, &create);
OpenPOWER on IntegriCloud