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

thin: detect discards for non-power-2

Check if target supports discards for chunk sizes,
that are not power of 2 (just multiple of 64K),
and enable it in case it's supported by thin kernel target.
This commit is contained in:
Zdenek Kabelac 2012-11-26 11:04:00 +01:00
parent 668b669d5b
commit 683b1f0625
3 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
Support discards for non-power-of-2 thin pool chunks.
Automatically restore MISSING PVs with no MDAs.
When no '-i' argument is given for RAID10, default to 2 stripes.
Do not allow --splitmirrors on RAID10 logical volumes.

View File

@ -51,6 +51,7 @@ enum {
THIN_FEATURE_EXTERNAL_ORIGIN = (1 << 1),
THIN_FEATURE_HELD_ROOT = (1 << 2),
THIN_FEATURE_BLOCK_SIZE = (1 << 3),
THIN_FEATURE_DISCARDS_NON_POWER_2 = (1 << 4),
};
void set_activation(int activation);

View File

@ -565,6 +565,12 @@ static int _thin_target_present(struct cmd_context *cmd,
/* FIXME Log this as WARNING later only if the user asked for the feature to be used but it's not present */
log_debug("Target " THIN_MODULE " does not support non power of 2 block sizes.");
if (maj >=1 && min >= 5)
_attrs |= THIN_FEATURE_DISCARDS_NON_POWER_2;
else
/* FIXME Log this as WARNING later only if the user asked for the feature to be used but it's not present */
log_debug("Target " THIN_MODULE " does not support discards for non power of 2 block sizes.");
_checked = 1;
}