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:
parent
fa832e3a55
commit
5778fdeeb8
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user