1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Add more initializations of 'mda->flags' field.

Mda allocation needs refactored into a single function but as an
interim step, ensure mda->flags is initialized properly.
This commit is contained in:
Dave Wysochanski 2010-06-29 14:52:56 +00:00
parent fa832e3a55
commit 5778fdeeb8
3 changed files with 6 additions and 1 deletions

View File

@ -467,13 +467,14 @@ static struct format_instance *_format1_create_instance(const struct format_type
dm_list_init(&fid->metadata_areas_ignored);
/* Define a NULL metadata area */
if (!(mda = dm_pool_alloc(fmt->cmd->mem, sizeof(*mda)))) {
if (!(mda = dm_pool_zalloc(fmt->cmd->mem, sizeof(*mda)))) {
dm_pool_free(fmt->cmd->mem, fid);
return_NULL;
}
mda->ops = &_metadata_format1_ops;
mda->metadata_locn = NULL;
mda->flags = 0;
dm_list_add(&fid->metadata_areas_in_use, &mda->list);
return fid;

View File

@ -275,6 +275,7 @@ static struct format_instance *_pool_create_instance(const struct format_type *f
mda->ops = &_metadata_format_pool_ops;
mda->metadata_locn = NULL;
mda->flags = 0;
dm_list_add(&fid->metadata_areas_in_use, &mda->list);
return fid;

View File

@ -1923,6 +1923,7 @@ static struct format_instance *_text_create_text_instance(const struct format_ty
return_NULL;
mda->ops = &_metadata_text_file_backup_ops;
mda->metadata_locn = context;
mda->flags = 0;
fid_add_mda(fid, mda);
} else {
dir_list = &((struct mda_lists *) fmt->private)->dirs;
@ -1940,6 +1941,7 @@ static struct format_instance *_text_create_text_instance(const struct format_ty
return_NULL;
mda->ops = &_metadata_text_file_ops;
mda->metadata_locn = context;
mda->flags = 0;
fid_add_mda(fid, mda);
}
@ -1959,6 +1961,7 @@ static struct format_instance *_text_create_text_instance(const struct format_ty
/* FIXME Allow multiple dev_areas inside area */
memcpy(&mdac->area, &rl->dev_area, sizeof(mdac->area));
mda->ops = &_metadata_text_raw_ops;
mda->flags = 0;
/* FIXME MISTAKE? mda->metadata_locn = context; */
fid_add_mda(fid, mda);
}