summaryrefslogtreecommitdiffstats
path: root/libdm
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2011-02-21 16:26:23 +0000
committerMike Snitzer <snitzer@redhat.com>2011-02-21 16:26:23 +0000
commit7d9c99e8e71aea7f55fc0e53e76e0154d69d4c2c (patch)
treeef88b81819cdbbd6faebfbb5dd21bf0b97fb0f55 /libdm
parentc901a92aa548c2794aa33f94384e3e1205804a3b (diff)
downloadlvm2-7d9c99e8e71aea7f55fc0e53e76e0154d69d4c2c.tar.gz
lvm2-7d9c99e8e71aea7f55fc0e53e76e0154d69d4c2c.tar.xz
lvm2-7d9c99e8e71aea7f55fc0e53e76e0154d69d4c2c.zip
Add inactive table query support for kernel driver >= 4.11.6 (RHEL 5.7).
Diffstat (limited to 'libdm')
-rw-r--r--libdm/ioctl/libdm-iface.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c
index 67b0ffe7..539f892d 100644
--- a/libdm/ioctl/libdm-iface.c
+++ b/libdm/ioctl/libdm-iface.c
@@ -992,6 +992,23 @@ int dm_cookie_supported(void)
_dm_version_minor >= 15);
}
+static int dm_inactive_supported(void)
+{
+ int inactive_supported = 0;
+
+ if (dm_check_version() && _dm_version >= 4) {
+ if (_dm_version_minor >= 16)
+ inactive_supported = 1; /* upstream */
+ else if (_dm_version_minor == 11 &&
+ (_dm_version_patchlevel >= 6 &&
+ _dm_version_patchlevel <= 40)) {
+ inactive_supported = 1; /* RHEL 5.7 */
+ }
+ }
+
+ return inactive_supported;
+}
+
void *dm_get_next_target(struct dm_task *dmt, void *next,
uint64_t *start, uint64_t *length,
char **target_type, char **params)
@@ -1548,7 +1565,7 @@ static struct dm_ioctl *_flatten(struct dm_task *dmt, unsigned repeat_count)
dmi->flags |= DM_SECURE_DATA_FLAG;
}
if (dmt->query_inactive_table) {
- if (_dm_version_minor < 16)
+ if (!dm_inactive_supported())
log_warn("WARNING: Inactive table query unsupported "
"by kernel. It will use live table.");
dmi->flags |= DM_QUERY_INACTIVE_TABLE_FLAG;