Skip duplicated dm version ioctl() on every startup.
if (!_integrity_checked) {
_integrity_checked = 1;
- _integrity_present = target_present(cmd, TARGET_NAME_INTEGRITY, 1);
-
- if (!target_version(TARGET_NAME_INTEGRITY, &maj, &min, &patchlevel))
+ if (!(_integrity_present = target_present_version(cmd, TARGET_NAME_INTEGRITY, 1,
+ &maj, &min, &patchlevel)))
return 0;
if (maj < 1 || min < 6) {
if (!_mirrored_checked) {
_mirrored_checked = 1;
- if (!(_mirrored_present = target_present(cmd, TARGET_NAME_MIRROR, 1)))
+ if (!(_mirrored_present = target_present_version(cmd, TARGET_NAME_MIRROR, 1,
+ &maj, &min, &patchlevel)))
return 0;
/*
if (!_raid_checked) {
_raid_checked = 1;
- if (!(_raid_present = target_present(cmd, TARGET_NAME_RAID, 1)))
- return 0;
-
- if (!target_version("raid", &maj, &min, &patchlevel))
+ if (!(_raid_present = target_present_version(cmd, TARGET_NAME_RAID, 1,
+ &maj, &min, &patchlevel)))
return_0;
for (i = 0; i < DM_ARRAY_SIZE(_features); ++i)
if (!_snap_checked) {
_snap_checked = 1;
- if (!(_snap_present = target_present(cmd, TARGET_NAME_SNAPSHOT, 1) &&
- target_present(cmd, TARGET_NAME_SNAPSHOT_ORIGIN, 0)))
+ if (!(_snap_present = (target_present_version(cmd, TARGET_NAME_SNAPSHOT, 1,
+ &maj, &min, &patchlevel) &&
+ target_present(cmd, TARGET_NAME_SNAPSHOT_ORIGIN, 0)))
return 0;
- if (target_version(TARGET_NAME_SNAPSHOT, &maj, &min, &patchlevel) &&
- (maj > 1 ||
+ if ((maj > 1 ||
(maj == 1 && (min >= 12 || (min == 10 && patchlevel >= 2)))))
_snap_attrs |= SNAPSHOT_FEATURE_FIXED_LEAK;
else
if (!_checked) {
_checked = 1;
- if (!(_present = target_present(cmd, _thin_pool_module, 1)))
+ if (!(_present = target_present_version(cmd, _thin_pool_module, 1,
+ &maj, &min, &patchlevel)))
return 0;
- if (!target_version(_thin_pool_module, &maj, &min, &patchlevel))
- return_0;
-
for (i = 0; i < DM_ARRAY_SIZE(_features); ++i)
if ((maj > _features[i].maj) ||
(maj == _features[i].maj && min >= _features[i].min))
/* Try to load kmod VDO module */
if (!module_present(cmd, MODULE_NAME_VDO) ||
!target_version(TARGET_NAME_VDO, &maj, &min, &patchlevel))
- return_0;
+ return 0;
}
if (maj < 6 || (maj == 6 && min < 2)) {
if (!_writecache_checked) {
_writecache_checked = 1;
- _writecache_present = target_present(cmd, TARGET_NAME_WRITECACHE, 1);
-
- if (!_writecache_present) {
- log_error("dm-writecache module not found in kernel.");
+ if (!(_writecache_present = target_present_version(cmd, TARGET_NAME_WRITECACHE, 1.
+ &maj, &min, &patchlevel)))
return 0;
- }
-
- if (!target_version(TARGET_NAME_WRITECACHE, &maj, &min, &patchlevel)) {
- log_error("dm-writecache module version not found.");
- return_0;
- }
if (maj < 1) {
log_error("dm-writecache module version older than minimum 1.0.0");