master - cache: with cache target 1.9 mq is alias to smq
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=588455d03ea40ffa37f466023691b0ec2bdf5e82 Commit: 588455d03ea40ffa37f466023691b0ec2bdf5e82 Parent: aa91fe3d3c3e6c2d8d96f5c0766b58375a44daa9 Author: Zdenek Kabelac <[email protected]> AuthorDate: Tue Apr 26 21:43:41 2016 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Tue Apr 26 23:24:05 2016 +0200
cache: with cache target 1.9 mq is alias to smq
Avoid useless check for mq policy, it's loaded as smq and aliased.
--- WHATS_NEW | 1 + lib/cache_segtype/cache.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.152 - ================================== + Stop checking for dm_cache_mq policy with cache target 1.9 (alias to smq). Check first /sys/module/dm_* dir existance before using modprobe. Remove mpath from 10-dm.rules, superseded by 11-dm-mpath.rules (mpath>=0.6.0).
lib/cache_segtype/cache.c +5 -2
@@ -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.",