1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

debug: shorter code

This commit is contained in:
Zdenek Kabelac 2021-09-27 11:52:16 +02:00
parent f74d30d411
commit e3b4c365a4

View File

@ -1082,62 +1082,23 @@ static int _vg_commit_raw_rlocn(struct format_instance *fid,
rlocn_set_ignored(rlocn_slot0, mda_is_ignored(mda)); rlocn_set_ignored(rlocn_slot0, mda_is_ignored(mda));
if (mdac->rlocn.size) { log_debug_metadata("VG %s metadata %scommit %sseq %u on %s mda header at %llu %s.",
if (precommit) { vg->name,
log_debug_metadata("VG %s metadata precommit seq %u on %s mda header at %llu %s", (precommit) ? "pre" : "",
vg->name, vg->seqno, dev_name(mdac->area.dev), (!mdac->rlocn.size) ? "empty ": "",
vg->seqno, dev_name(mdac->area.dev),
(unsigned long long)mdac->area.start, (unsigned long long)mdac->area.start,
mda_is_ignored(mda) ? "(ignored)" : "(used)"); mda_is_ignored(mda) ? "(ignored)" : "(used)");
log_debug_metadata("VG %s metadata precommit slot0 offset %llu size %llu slot1 offset %llu size %llu", log_debug_metadata("VG %s metadata %scommit %sslot0 offset %llu size %llu slot1 offset %llu size %llu.",
vg->name, vg->name,
(precommit) ? "pre" : "",
(!mdac->rlocn.size) ? "empty ": "",
(unsigned long long)mdab->raw_locns[0].offset, (unsigned long long)mdab->raw_locns[0].offset,
(unsigned long long)mdab->raw_locns[0].size, (unsigned long long)mdab->raw_locns[0].size,
(unsigned long long)mdab->raw_locns[1].offset, (unsigned long long)mdab->raw_locns[1].offset,
(unsigned long long)mdab->raw_locns[1].size); (unsigned long long)mdab->raw_locns[1].size);
} else {
log_debug_metadata("VG %s metadata commit seq %u on %s mda header at %llu %s",
vg->name, vg->seqno, dev_name(mdac->area.dev),
(unsigned long long)mdac->area.start,
mda_is_ignored(mda) ? "(ignored)" : "(used)");
log_debug_metadata("VG %s metadata commit slot0 offset %llu size %llu slot1 offset %llu size %llu",
vg->name,
(unsigned long long)mdab->raw_locns[0].offset,
(unsigned long long)mdab->raw_locns[0].size,
(unsigned long long)mdab->raw_locns[1].offset,
(unsigned long long)mdab->raw_locns[1].size);
}
} else {
if (precommit) {
log_debug_metadata("VG %s metadata precommit empty seq %u on %s mda header at %llu %s",
vg->name, vg->seqno, dev_name(mdac->area.dev),
(unsigned long long)mdac->area.start,
mda_is_ignored(mda) ? "(ignored)" : "(used)");
log_debug_metadata("VG %s metadata precommit empty slot0 offset %llu size %llu slot1 offset %llu size %llu",
vg->name,
(unsigned long long)mdab->raw_locns[0].offset,
(unsigned long long)mdab->raw_locns[0].size,
(unsigned long long)mdab->raw_locns[1].offset,
(unsigned long long)mdab->raw_locns[1].size);
} else {
log_debug_metadata("VG %s metadata commit empty seq %u on %s mda header at %llu %s",
vg->name, vg->seqno, dev_name(mdac->area.dev),
(unsigned long long)mdac->area.start,
mda_is_ignored(mda) ? "(ignored)" : "(used)");
log_debug_metadata("VG %s metadata commit empty slot0 offset %llu size %llu slot1 offset %llu size %llu",
vg->name,
(unsigned long long)mdab->raw_locns[0].offset,
(unsigned long long)mdab->raw_locns[0].size,
(unsigned long long)mdab->raw_locns[1].offset,
(unsigned long long)mdab->raw_locns[1].size);
}
}
rlocn_set_ignored(mdab->raw_locns, mda_is_ignored(mda)); rlocn_set_ignored(mdab->raw_locns, mda_is_ignored(mda));
if (!_raw_write_mda_header(fid->fmt, mdac->area.dev, mda_is_primary(mda), mdac->area.start, if (!_raw_write_mda_header(fid->fmt, mdac->area.dev, mda_is_primary(mda), mdac->area.start,