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

Add some log_verbose debug statements related to metadataignore.

Logging isn't ideal, especially for mda_set_ignore.  Ideally we'd
like to display the device name and offset in this case but this
requires a bit more work and a per-format 'mda_description' function
pointer definition (we don't have access to mda_context in
metadata.c).
This commit is contained in:
Dave Wysochanski 2010-06-29 22:25:58 +00:00
parent a375ced300
commit 710c9373bf
3 changed files with 13 additions and 4 deletions

View File

@ -312,6 +312,10 @@ static int _text_read(struct labeller *l, struct device *dev, void *buf,
mda_set_ignored(mda, rlocn_is_ignored(mdah->raw_locns));
if (mda_is_ignored(mda)) {
log_verbose("Skipping mda with ignored flag on "
"device %s at offset %"PRIu64,
dev_name(mdac->area.dev),
mdac->area.start);
if (!dev_close(mdac->area.dev))
stack;
continue;

View File

@ -4117,12 +4117,17 @@ unsigned mda_is_ignored(struct metadata_area *mda)
return (mda->flags & MDA_IGNORED);
}
void mda_set_ignored(struct metadata_area *mda, int value)
void mda_set_ignored(struct metadata_area *mda, unsigned ignored)
{
if (value)
if (ignored) {
mda->flags |= MDA_IGNORED;
else
log_verbose("Setting mda ignored flag for metadata_locn %p.",
mda->metadata_locn);
} else {
mda->flags &= ~MDA_IGNORED;
log_verbose("Clearing mda ignored flag for metadata_locn %p.",
mda->metadata_locn);
}
}
uint32_t pv_mda_count(const struct physical_volume *pv)

View File

@ -181,7 +181,7 @@ struct metadata_area *mda_copy(struct dm_pool *mem,
struct metadata_area *mda);
unsigned mda_is_ignored(struct metadata_area *mda);
void mda_set_ignored(struct metadata_area *mda, int value);
void mda_set_ignored(struct metadata_area *mda, unsigned ignored);
unsigned mda_locns_match(struct metadata_area *mda1, struct metadata_area *mda2);
void fid_add_mda(struct format_instance *fid, struct metadata_area *mda);
int fid_add_mdas(struct format_instance *fid, struct dm_list *mdas);