summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2012-07-27 20:03:07 +0100
committerAlasdair G Kergon <agk@redhat.com>2012-07-27 20:03:07 +0100
commit25ae0b39b77d80990d0821729ab4f2307bd38c16 (patch)
tree4a902a55dcf4708f6d7a6d2febcf661fde2ad7aa
parent186a2772e8ac3c2088bdfc833c32d773464d666b (diff)
downloadlvm2-25ae0b39b77d80990d0821729ab4f2307bd38c16.tar.gz
lvm2-25ae0b39b77d80990d0821729ab4f2307bd38c16.tar.xz
lvm2-25ae0b39b77d80990d0821729ab4f2307bd38c16.zip
dmsetup: allow --noflush with status/wait for thin
Allow --noflush with dmsetup status and wait (for thin target 1.3.0 / ioctl 4.23.0).
-rw-r--r--WHATS_NEW_DM1
-rw-r--r--libdm/misc/dm-ioctl.h12
-rw-r--r--man/dmsetup.8.in9
-rw-r--r--tools/dmsetup.c7
4 files changed, 21 insertions, 8 deletions
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 0bfd0167..a790ccf7 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.76 -
===============================
+ Allow --noflush with dmsetup status and wait (for thin target).
Add dm_config_write_one_node to libdevmapper.
Add support for thin pool message release/reserve_metadata_snap.
Add support for thin pool discard and external origin.
diff --git a/libdm/misc/dm-ioctl.h b/libdm/misc/dm-ioctl.h
index c0313150..1cf66fef 100644
--- a/libdm/misc/dm-ioctl.h
+++ b/libdm/misc/dm-ioctl.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2001 - 2003 Sistina Software (UK) Limited.
- * Copyright (C) 2004 - 2009 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004 - 2012 Red Hat, Inc. All rights reserved.
*
* This file is released under the LGPL.
*/
@@ -269,9 +269,9 @@ enum {
#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 20
+#define DM_VERSION_MINOR 23
#define DM_VERSION_PATCHLEVEL 0
-#define DM_VERSION_EXTRA "-ioctl (2011-02-02)"
+#define DM_VERSION_EXTRA "-ioctl (2012-07-25)"
/* Status bits */
#define DM_READONLY_FLAG (1 << 0) /* In/Out */
@@ -309,6 +309,8 @@ enum {
/*
* Set this to suspend without flushing queued ios.
+ * Also disables flushing uncommitted changes in the thin target before
+ * generating statistics for DM_TABLE_STATUS and DM_DEV_WAIT.
*/
#define DM_NOFLUSH_FLAG (1 << 11) /* In */
@@ -331,8 +333,8 @@ enum {
#define DM_UUID_FLAG (1 << 14) /* In */
/*
- * If set, all buffers are wiped after use. Used when sending
- * or requesting sensitive data like crypt key.
+ * If set, all buffers are wiped after use. Use when sending
+ * or requesting sensitive data such as an encryption key.
*/
#define DM_SECURE_DATA_FLAG (1 << 15) /* In */
diff --git a/man/dmsetup.8.in b/man/dmsetup.8.in
index 8eb679b9..90c715f4 100644
--- a/man/dmsetup.8.in
+++ b/man/dmsetup.8.in
@@ -109,6 +109,7 @@ dmsetup \- low level logical volume management
.B dmsetup status
.RB [ \-\-target
.IR target_type ]
+.RB [ \-\-noflush ]
.RI [ device_name ]
.br
.B dmsetup suspend
@@ -143,6 +144,7 @@ dmsetup \- low level logical volume management
.B dmsetup version
.br
.B dmsetup wait
+.RB [ \-\-noflush ]
.I device_name
.RI [ event_nr ]
.br
@@ -477,11 +479,13 @@ Default subsystem is LVM.
.B status
.RB [ \-\-target
.IR target_type ]
+.RB [ \-\-noflush ]
.RI [ device_name ]
.br
Outputs status information for each of the device's targets.
With \-\-target, only information relating to the specified target type
-is displayed.
+any is displayed. With \-\-noflush, the thin target (from version 1.3.0)
+doesn't commit any outstanding changes to disk before reporting its statistics.
.br
.HP
.B suspend
@@ -577,6 +581,7 @@ Outputs version information.
.TP
.B wait
+.RB [ \-\-noflush ]
.I device_name
.RI [ event_nr ]
.br
@@ -584,6 +589,8 @@ Sleeps until the event counter for device_name exceeds event_nr.
Use \-v to see the event number returned.
To wait until the next event is triggered, use \fBinfo\fP to find
the last event number.
+With \-\-noflush, the thin target (from version 1.3.0) doesn't commit
+any outstanding changes to disk before reporting its statistics.
.SH TABLE FORMAT
Each line of the table specifies a single target and is of the form:
.P
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 2787b766..5422f0b3 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -1642,6 +1642,9 @@ static int _status(CMD_ARGS)
if (_switches[CHECKS_ARG] && !dm_task_enable_checks(dmt))
goto out;
+ if (_switches[NOFLUSH_ARG] && !dm_task_no_flush(dmt))
+ goto out;
+
if (!dm_task_run(dmt))
goto out;
@@ -2994,9 +2997,9 @@ static struct command _commands[] = {
{"ls", "[--target <target_type>] [--exec <command>] [-o options] [--tree]", 0, 0, 0, _ls},
{"info", "[<device>]", 0, -1, 1, _info},
{"deps", "[-o options] [<device>]", 0, -1, 1, _deps},
- {"status", "[<device>] [--target <target_type>]", 0, -1, 1, _status},
+ {"status", "[<device>] [--noflush] [--target <target_type>]", 0, -1, 1, _status},
{"table", "[<device>] [--target <target_type>] [--showkeys]", 0, -1, 1, _status},
- {"wait", "<device> [<event_nr>]", 0, 2, 0, _wait},
+ {"wait", "<device> [<event_nr>] [--noflush]", 0, 2, 0, _wait},
{"mknodes", "[<device>]", 0, -1, 1, _mknodes},
{"mangle", "[<device>]", 0, -1, 1, _mangle},
{"udevcreatecookie", "", 0, 0, 0, _udevcreatecookie},