1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

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).
This commit is contained in:
Alasdair G Kergon 2012-07-27 20:03:07 +01:00
parent 186a2772e8
commit 25ae0b39b7
4 changed files with 21 additions and 8 deletions

View File

@ -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.

View File

@ -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 */

View File

@ -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

View File

@ -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},