Skip to contentSkip to conversation

LVM2 ./WHATS_NEW_DM libdm/.exported_symbols li ...

PATCH [email protected] 1 participant 1 message Nov 6, 2009

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: agk at sourceware.org 2009-11-06 00:43:10

Modified files:

	.              : WHATS_NEW_DM 
	libdm          : .exported_symbols libdevmapper.h libdm-common.c 
	libdm/ioctl    : libdm-iface.c libdm-targets.h 
	libdm/misc     : dm-ioctl.h 
	man            : dmsetup.8.in 
	tools          : dmsetup.c 

Log message:
Add support for querying a device's inactive table. Currently this data is invisible to userspace. Requires dm >= 4.16 (likely to be in linux 2.6.33).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.311&r2=1.312
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/.exported_symbols.diff?cvsroot=lvm2&r1=1.44&r2=1.45
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.100&r2=1.101
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-common.c.diff?cvsroot=lvm2&r1=1.89&r2=1.90
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/ioctl/libdm-iface.c.diff?cvsroot=lvm2&r1=1.64&r2=1.65
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/ioctl/libdm-targets.h.diff?cvsroot=lvm2&r1=1.25&r2=1.26
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/misc/dm-ioctl.h.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/dmsetup.8.in.diff?cvsroot=lvm2&r1=1.27&r2=1.28
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/dmsetup.c.diff?cvsroot=lvm2&r1=1.126&r2=1.127

WHATS_NEW_DM +2 -0
@@ -1,5 +1,7 @@
 Version 1.02.40 - 
 ===================================
+  Add dmsetup --inactive support.
+  Add dm_task_query_inactive_table to libdevmapper for kernel driver >= 4.16.
   Fix hash lookup segfault when keys compared are different lengths.
 
 Version 1.02.39 - 26th October 2009
libdm/.exported_symbols +1 -0
@@ -40,6 +40,7 @@
 dm_task_no_flush
 dm_task_no_open_count
 dm_task_skip_lockfs
+dm_task_query_inactive_table
 dm_task_update_nodes
 dm_task_run
 dm_get_next_target
libdm/libdevmapper.h +1 -0
@@ -172,6 +172,7 @@
 int dm_task_no_flush(struct dm_task *dmt);
 int dm_task_no_open_count(struct dm_task *dmt);
 int dm_task_skip_lockfs(struct dm_task *dmt);
+int dm_task_query_inactive_table(struct dm_task *dmt);
 int dm_task_suppress_identical_reload(struct dm_task *dmt);
 
 /*
libdm/libdm-common.c +1 -0
@@ -181,6 +181,7 @@
 	dmt->read_ahead_flags = 0;
 	dmt->event_nr = 0;
 	dmt->cookie_set = 0;
+	dmt->query_inactive_table = 0;
 
 	return dmt;
 }
libdm/ioctl/libdm-iface.c +15 -1
@@ -1135,6 +1135,13 @@
 	return 1;
 }
 
+int dm_task_query_inactive_table(struct dm_task *dmt)
+{
+	dmt->query_inactive_table = 1;
+
+	return 1;
+}
+
 int dm_task_set_event_nr(struct dm_task *dmt, uint32_t event_nr)
 {
 	dmt->event_nr = event_nr;
@@ -1382,6 +1389,12 @@
 		dmi->flags |= DM_READONLY_FLAG;
 	if (dmt->skip_lockfs)
 		dmi->flags |= DM_SKIP_LOCKFS_FLAG;
+	if (dmt->query_inactive_table) {
+		if (_dm_version_minor < 16)
+			log_warn("WARNING: Inactive table query unsupported "
+				 "by kernel.  It will use live table.");
+		dmi->flags |= DM_QUERY_INACTIVE_TABLE_FLAG;
+	}
 
 	dmi->target_count = count;
 	dmi->event_nr = dmt->event_nr;
@@ -1723,7 +1736,7 @@
 	}
 
 	log_debug("dm %s %s %s%s%s %s%.0d%s%.0d%s"
-		  "%s%c%c%s %.0" PRIu64 " %s [%u]",
+		  "%s%c%c%s%s %.0" PRIu64 " %s [%u]",
 		  _cmd_data_v4[dmt->type].name,
 		  dmi->name, dmi->uuid, dmt->newname ? " " : "",
 		  dmt->newname ? dmt->newname : "",
@@ -1736,6 +1749,7 @@
 		  dmt->no_open_count ? 'N' : 'O',
 		  dmt->no_flush ? 'N' : 'F',
 		  dmt->skip_lockfs ? "S " : "",
+		  dmt->query_inactive_table ? "I " : "",
 		  dmt->sector, dmt->message ? dmt->message : "",
 		  dmi->data_size);
 #ifdef DM_IOCTLS
libdm/ioctl/libdm-targets.h +1 -0
@@ -58,6 +58,7 @@
 	int no_flush;
 	int no_open_count;
 	int skip_lockfs;
+	int query_inactive_table;
 	int suppress_identical_reload;
 	uint64_t existing_table_size;
 	int cookie_set;
libdm/misc/dm-ioctl.h +10 -3
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2001 - 2003 Sistina Software (UK) Limited.
- * Copyright (C) 2004 - 2005 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004 - 2009 Red Hat, Inc. All rights reserved.
  *
  * This file is released under the LGPL.
  */
@@ -268,9 +268,9 @@
 #define DM_DEV_SET_GEOMETRY	_IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
 
 #define DM_VERSION_MAJOR	4
-#define DM_VERSION_MINOR	15
+#define DM_VERSION_MINOR	16
 #define DM_VERSION_PATCHLEVEL	0
-#define DM_VERSION_EXTRA	"-ioctl (2009-04-01)"
+#define DM_VERSION_EXTRA	"-ioctl (2009-11-05)"
 
 /* Status bits */
 #define DM_READONLY_FLAG	(1 << 0) /* In/Out */
@@ -311,4 +311,11 @@
  */
 #define DM_NOFLUSH_FLAG		(1 << 11) /* In */
 
+/*
+ * If set, any table information returned will relate to the inactive
+ * table instead of the live one.  Always check DM_INACTIVE_PRESENT_FLAG
+ * is set before using the data returned.
+ */
+#define DM_QUERY_INACTIVE_TABLE_FLAG	(1 << 12) /* In */
+
 #endif				/* _LINUX_DM_IOCTL_H */
man/dmsetup.8.in +7 -2
@@ -107,6 +107,11 @@
 .IP \fB-c|-C|--columns
 .br
 Display output in columns rather than as Field: Value lines.
+.IP \fB--inactive
+.br
+When returning any table information from the kernel report on the 
+inactive table instead of the live table.
+Requires kernel driver version 4.16.0 or above.
 .IP \fB-j|--major\ \fImajor
 .br
 Specify the major number.
@@ -277,7 +282,7 @@
 Splits given device name into subsystem constituents.
 Default subsystem is LVM.
 .IP \fBstatus
-.I [--target target_type]
+.I [--target target_type] [--inactive]
 .I [device_name]
 .br
 Outputs status information for each of the device's targets.
@@ -296,7 +301,7 @@
 the --noflush option.  This lets outstanding I/O that has not yet reached the
 device to remain unflushed.
 .IP \fBtable
-.I [--target target_type]
+.I [--target target_type] [--inactive]
 .I [device_name]
 .br
 Outputs the current table for the device in a format that can be fed
tools/dmsetup.c +44 -1

141 lines not on this page · raw message