diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2021-02-07 21:48:18 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2021-02-08 23:43:38 +0100 |
commit | 9b173bb931426cd1d35beb5ec5151289112b2568 (patch) | |
tree | fc2fffb560777f6ce2ce413bbc52f51984e6774f /lib/snapshot | |
parent | 6373f3909252e312ca2b25d42a46a712099ae7fc (diff) | |
download | lvm2-9b173bb931426cd1d35beb5ec5151289112b2568.tar.gz |
targets: use target_present_version
Skip duplicated dm version ioctl() on every startup.
Diffstat (limited to 'lib/snapshot')
-rw-r--r-- | lib/snapshot/snapshot.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/snapshot/snapshot.c b/lib/snapshot/snapshot.c index 3c30b3576..b832f890d 100644 --- a/lib/snapshot/snapshot.c +++ b/lib/snapshot/snapshot.c @@ -152,12 +152,12 @@ static int _snap_target_present(struct cmd_context *cmd, 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 |