From: Joe Thornber <[email-masked]>

dm thin metadata: lift initialisation of some vars out of __format_or_open_metadata

Code tidy.

Signed-off-by: Joe Thornber <[email-masked]>
Signed-off-by: Mike Snitzer <[email-masked]>
---
 drivers/md/dm-thin-metadata.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Index: linux/drivers/md/dm-thin-metadata.c
===================================================================
--- linux.orig/drivers/md/dm-thin-metadata.c
+++ linux/drivers/md/dm-thin-metadata.c
@@ -489,14 +489,11 @@ static int __open_or_format_metadata(str
 	}
 
 	__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;
 
@@ -713,6 +710,9 @@ struct dm_pool_metadata *dm_pool_metadat
 		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);