summaryrefslogtreecommitdiff
path: root/lib/cache_segtype
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2016-04-26 21:43:41 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2016-04-26 23:24:05 +0200
commit588455d03ea40ffa37f466023691b0ec2bdf5e82 (patch)
tree7122f5e9a78900003c09b48d8cad1e251891960d /lib/cache_segtype
parentaa91fe3d3c3e6c2d8d96f5c0766b58375a44daa9 (diff)
downloadlvm2-588455d03ea40ffa37f466023691b0ec2bdf5e82.tar.gz
cache: with cache target 1.9 mq is alias to smq
Avoid useless check for mq policy, it's loaded as smq and aliased.
Diffstat (limited to 'lib/cache_segtype')
-rw-r--r--lib/cache_segtype/cache.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c
index a65892e7f..be9a57eff 100644
--- a/lib/cache_segtype/cache.c
+++ b/lib/cache_segtype/cache.c
@@ -211,8 +211,9 @@ static int _target_present(struct cmd_context *cmd,
const char feature[12];
const char module[12]; /* check dm-%s */
} _features[] = {
- { 1, 3, CACHE_FEATURE_POLICY_MQ, "policy_mq", "cache-mq" },
+ { 1, 9, CACHE_FEATURE_POLICY_SMQ | CACHE_FEATURE_POLICY_MQ, "policy_smq", "cache-smq" },
{ 1, 8, CACHE_FEATURE_POLICY_SMQ, "policy_smq", "cache-smq" },
+ { 1, 3, CACHE_FEATURE_POLICY_MQ, "policy_mq", "cache-mq" },
};
static const char _lvmconf[] = "global/cache_disabled_features";
static unsigned _attrs = 0;
@@ -249,7 +250,9 @@ static int _target_present(struct cmd_context *cmd,
for (i = 0; i < DM_ARRAY_SIZE(_features); ++i) {
if (((maj > _features[i].maj) ||
(maj == _features[i].maj && min >= _features[i].min)) &&
- (!_features[i].module[0] || module_present(cmd, _features[i].module)))
+ (!_features[i].module[0] ||
+ (_attrs & _features[i].cache_feature) || /* already present */
+ module_present(cmd, _features[i].module)))
_attrs |= _features[i].cache_feature;
else
log_very_verbose("Target %s does not support %s.",