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>
This commit is contained in:
Joe Thornber 2012-07-27 15:08:13 +01:00 коммит произвёл Alasdair G Kergon
Родитель 237074c0a3
Коммит 8801e06945
1 изменённых файлов: 7 добавлений и 10 удалений

Просмотреть файл

@ -595,23 +595,21 @@ bad:
return r; return r;
} }
static int __open_or_format_metadata(struct dm_pool_metadata *pmd, static int __open_or_format_metadata(struct dm_pool_metadata *pmd)
int *create)
{ {
int r; int r, unformatted;
r = __superblock_all_zeroes(pmd->bm, create); r = __superblock_all_zeroes(pmd->bm, &unformatted);
if (r) if (r)
return r; return r;
if (*create) if (unformatted)
return __format_metadata(pmd); return __format_metadata(pmd);
else else
return __open_metadata(pmd); return __open_metadata(pmd);
} }
static int __create_persistent_data_objects(struct dm_pool_metadata *pmd, static int __create_persistent_data_objects(struct dm_pool_metadata *pmd)
int *create)
{ {
int r; int r;
@ -623,7 +621,7 @@ static int __create_persistent_data_objects(struct dm_pool_metadata *pmd,
return PTR_ERR(pmd->bm); return PTR_ERR(pmd->bm);
} }
r = __open_or_format_metadata(pmd, create); r = __open_or_format_metadata(pmd);
if (r) if (r)
dm_block_manager_destroy(pmd->bm); dm_block_manager_destroy(pmd->bm);
@ -794,7 +792,6 @@ struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev,
{ {
int r; int r;
struct dm_pool_metadata *pmd; struct dm_pool_metadata *pmd;
int create;
pmd = kmalloc(sizeof(*pmd), GFP_KERNEL); pmd = kmalloc(sizeof(*pmd), GFP_KERNEL);
if (!pmd) { if (!pmd) {
@ -808,7 +805,7 @@ struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev,
pmd->bdev = bdev; pmd->bdev = bdev;
pmd->data_block_size = data_block_size; pmd->data_block_size = data_block_size;
r = __create_persistent_data_objects(pmd, &create); r = __create_persistent_data_objects(pmd);
if (r) { if (r) {
kfree(pmd); kfree(pmd);
return ERR_PTR(r); return ERR_PTR(r);