mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
Rename 'flags' to 'status' for struct metadata_area.
In other LVM memory structures such as volume_group, the field used to store flags is called "status", and on-disk fields are called 'flags', so rename the one inside metadata_area to be consistent. Not only is it more consistent with existing code but is cleaner to say "the status of this mda is ignored". Background for this patch - prajnoha pinged me on IRC this morning about a fix he was working on related to metadataignore when metadata/dirs was set. I was reviewing my patches from this year and realized the 'flags' field was probably not the best choice when I originally did the metadataignore patches.
This commit is contained in:
parent
2da49b93bd
commit
600e67b17a
@ -1,5 +1,6 @@
|
||||
Version 2.02.75 -
|
||||
=====================================
|
||||
Rename 'flags' to 'status' in struct metadata_area.
|
||||
Avoid segfault by limiting partial mode for lvm1 metadata. (2.02.74)
|
||||
Add dm_zalloc and use it and dm_pool_zalloc throughout.
|
||||
Add pv_get_property and create generic internal _get_property function.
|
||||
|
@ -545,7 +545,7 @@ static struct format_instance *_format1_create_instance(const struct format_type
|
||||
|
||||
mda->ops = &_metadata_format1_ops;
|
||||
mda->metadata_locn = NULL;
|
||||
mda->flags = 0;
|
||||
mda->status = 0;
|
||||
dm_list_add(&fid->metadata_areas_in_use, &mda->list);
|
||||
|
||||
return fid;
|
||||
|
@ -276,7 +276,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;
|
||||
mda->status = 0;
|
||||
dm_list_add(&fid->metadata_areas_in_use, &mda->list);
|
||||
|
||||
return fid;
|
||||
|
@ -1947,7 +1947,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;
|
||||
mda->status = 0;
|
||||
fid_add_mda(fid, mda);
|
||||
} else {
|
||||
dir_list = &((struct mda_lists *) fmt->private)->dirs;
|
||||
@ -1965,7 +1965,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;
|
||||
mda->status = 0;
|
||||
fid_add_mda(fid, mda);
|
||||
}
|
||||
|
||||
@ -1985,7 +1985,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;
|
||||
mda->status = 0;
|
||||
/* FIXME MISTAKE? mda->metadata_locn = context; */
|
||||
fid_add_mda(fid, mda);
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ int add_mda(const struct format_type *fmt, struct dm_pool *mem, struct dm_list *
|
||||
|
||||
mdal->ops = mda_lists->raw_ops;
|
||||
mdal->metadata_locn = mdac;
|
||||
mdal->flags = 0;
|
||||
mdal->status = 0;
|
||||
|
||||
mdac->area.dev = dev;
|
||||
mdac->area.start = start;
|
||||
|
@ -3839,7 +3839,7 @@ unsigned mda_locns_match(struct metadata_area *mda1, struct metadata_area *mda2)
|
||||
|
||||
unsigned mda_is_ignored(struct metadata_area *mda)
|
||||
{
|
||||
return (mda->flags & MDA_IGNORED);
|
||||
return (mda->status & MDA_IGNORED);
|
||||
}
|
||||
|
||||
void mda_set_ignored(struct metadata_area *mda, unsigned mda_ignored)
|
||||
@ -3848,9 +3848,9 @@ void mda_set_ignored(struct metadata_area *mda, unsigned mda_ignored)
|
||||
unsigned old_mda_ignored = mda_is_ignored(mda);
|
||||
|
||||
if (mda_ignored && !old_mda_ignored)
|
||||
mda->flags |= MDA_IGNORED;
|
||||
mda->status |= MDA_IGNORED;
|
||||
else if (!mda_ignored && old_mda_ignored)
|
||||
mda->flags &= ~MDA_IGNORED;
|
||||
mda->status &= ~MDA_IGNORED;
|
||||
else
|
||||
return; /* No change */
|
||||
|
||||
|
@ -182,7 +182,7 @@ struct metadata_area {
|
||||
struct dm_list list;
|
||||
struct metadata_area_ops *ops;
|
||||
void *metadata_locn;
|
||||
uint32_t flags;
|
||||
uint32_t status;
|
||||
};
|
||||
struct metadata_area *mda_copy(struct dm_pool *mem,
|
||||
struct metadata_area *mda);
|
||||
|
Loading…
Reference in New Issue
Block a user