1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-10-28 15:33:16 +03:00

Update heuristic used for default and detected data alignment.

Add "devices/default_data_alignment" to lvm.conf to control the internal
default that LVM2 uses: 0==64k, 1==1MB, 2==2MB, etc.

If --dataalignment (or lvm.conf's "devices/data_alignment") is specified
then it is always used to align the start of the data area.  This means
the md_chunk_alignment and data_alignment_detection are disabled if set.

(Same now applies to pvcreate --dataalignmentoffset, the specified value
will be used instead of the result from data_alignment_offset_detection)

set_pe_align() still looks to use the determined default alignment
(based on lvm.conf's default_data_alignment) if the default is a
multiple of the MD or topology detected values.
This commit is contained in:
Mike Snitzer
2010-08-20 20:59:05 +00:00
parent aa06d91972
commit 4efb1d9cbb
5 changed files with 58 additions and 26 deletions

View File

@@ -1861,16 +1861,20 @@ static int _text_pv_setup(const struct format_type *fmt,
0) * 2;
if (set_pe_align(pv, data_alignment) != data_alignment &&
data_alignment)
log_warn("WARNING: %s: Overriding data alignment to "
"%lu sectors (requested %lu sectors)",
pv_dev_name(pv), pv->pe_align, data_alignment);
data_alignment) {
log_error("%s: invalid data alignment of "
"%lu sectors (requested %lu sectors)",
pv_dev_name(pv), pv->pe_align, data_alignment);
return 0;
}
if (set_pe_align_offset(pv, data_alignment_offset) != data_alignment_offset &&
data_alignment_offset)
log_warn("WARNING: %s: Overriding data alignment offset to "
"%lu sectors (requested %lu sectors)",
pv_dev_name(pv), pv->pe_align_offset, data_alignment_offset);
data_alignment_offset) {
log_error("%s: invalid data alignment offset of "
"%lu sectors (requested %lu sectors)",
pv_dev_name(pv), pv->pe_align_offset, data_alignment_offset);
return 0;
}
if (pv->pe_align < pv->pe_align_offset) {
log_error("%s: pe_align (%lu sectors) must not be less "