mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
cache: better support for alias check
To still support disabling of policies for test we need better logic for alias detection introduced in 588455d03ea40ffa37f466023691b0ec2bdf5e82.
This commit is contained in:
parent
2a2efab0b1
commit
49f32e4859
@ -208,12 +208,13 @@ static int _target_present(struct cmd_context *cmd,
|
|||||||
uint32_t maj;
|
uint32_t maj;
|
||||||
uint32_t min;
|
uint32_t min;
|
||||||
unsigned cache_feature;
|
unsigned cache_feature;
|
||||||
|
unsigned cache_alias;
|
||||||
const char feature[12];
|
const char feature[12];
|
||||||
const char module[12]; /* check dm-%s */
|
const char module[12]; /* check dm-%s */
|
||||||
} _features[] = {
|
} _features[] = {
|
||||||
{ 1, 9, CACHE_FEATURE_POLICY_SMQ | CACHE_FEATURE_POLICY_MQ, "policy_smq", "cache-smq" },
|
{ 1, 9, 0, CACHE_FEATURE_POLICY_MQ, "policy_smq", "cache-smq" },
|
||||||
{ 1, 8, CACHE_FEATURE_POLICY_SMQ, "policy_smq", "cache-smq" },
|
{ 1, 8, CACHE_FEATURE_POLICY_SMQ, 0, "policy_smq", "cache-smq" },
|
||||||
{ 1, 3, CACHE_FEATURE_POLICY_MQ, "policy_mq", "cache-mq" },
|
{ 1, 3, CACHE_FEATURE_POLICY_MQ, 0, "policy_mq", "cache-mq" },
|
||||||
};
|
};
|
||||||
static const char _lvmconf[] = "global/cache_disabled_features";
|
static const char _lvmconf[] = "global/cache_disabled_features";
|
||||||
static unsigned _attrs = 0;
|
static unsigned _attrs = 0;
|
||||||
@ -253,7 +254,8 @@ static int _target_present(struct cmd_context *cmd,
|
|||||||
(!_features[i].module[0] ||
|
(!_features[i].module[0] ||
|
||||||
(_attrs & _features[i].cache_feature) || /* already present */
|
(_attrs & _features[i].cache_feature) || /* already present */
|
||||||
module_present(cmd, _features[i].module)))
|
module_present(cmd, _features[i].module)))
|
||||||
_attrs |= _features[i].cache_feature;
|
_attrs |= _features[i].cache_feature |
|
||||||
|
_features[i].cache_alias;
|
||||||
else
|
else
|
||||||
log_very_verbose("Target %s does not support %s.",
|
log_very_verbose("Target %s does not support %s.",
|
||||||
_cache_module, _features[i].feature);
|
_cache_module, _features[i].feature);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user