master - pre-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6022715c817953...
Commit: 6022715c817953e48cfcec127e95f51a0b843ad3
Parent: dfcdfa057bad1ea231f89b11ebcc761ffc49d922
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed Jul 6 00:59:28 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed Jul 6 00:59:28 2016 +0100
pre-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 4 ++--
WHATS_NEW_DM | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/VERSION b/VERSION
index 6605e1a..11d74a2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.159(2)-git (2016-06-25)
+2.02.159(2)-git (2016-07-06)
diff --git a/VERSION_DM b/VERSION_DM
index 87ac527..f7d3636 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.129-git (2016-06-25)
+1.02.129-git (2016-07-06)
diff --git a/WHATS_NEW b/WHATS_NEW
index e35ca82..a7a2228 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,5 @@
-Version 2.02.159 -
-=================================
+Version 2.02.159 - 6th July 2016
+================================
Add raid0_meta segment type that provides metadata space for raid conversions.
Fix created link for a used pool for vgmknode.
Introduce and use is_power_of_2 macro.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 76a4106..44208ad 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,5 @@
-Version 1.02.129 -
-=================================
+Version 1.02.129 - 6th July 2016
+================================
Update default dmstats field selections for groups.
Add 'obj_type', 'group_id', and 'statsname' fields to dmstats reports.
Add --area, --region, and --group to dmstats to control object selection.
7 years, 10 months
master - vgsplit: Don't skip moving internal snapshot LV.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=dfcdfa057bad1e...
Commit: dfcdfa057bad1ea231f89b11ebcc761ffc49d922
Parent: 4d4f48af9f18b9407c065cdc035cf8e397e08ac0
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Jul 5 23:08:14 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Jul 5 23:08:14 2016 +0100
vgsplit: Don't skip moving internal snapshot LV.
Also place snapshot LV handling back at the end, after all possible
origin and cow LVs got dealt with.
---
tools/vgsplit.c | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/tools/vgsplit.c b/tools/vgsplit.c
index afe87af..221600e 100644
--- a/tools/vgsplit.c
+++ b/tools/vgsplit.c
@@ -190,10 +190,6 @@ static int _move_snapshots(struct volume_group *vg_from,
if (!(lv->status & SNAPSHOT))
continue;
- /* Ignore, if no allocations on PVs of @vg_to */
- if (!lv_is_on_pvs(lv, &vg_to->pvs))
- continue;
-
dm_list_iterate_items(seg, &lv->segments) {
cow_from = _lv_is_in_vg(vg_from, seg->cow);
origin_from = _lv_is_in_vg(vg_from, seg->origin);
@@ -680,17 +676,18 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv)
if (!(_move_mirrors(vg_from, vg_to)))
goto_bad;
- /* Move required snapshots across */
- if (!(_move_snapshots(vg_from, vg_to)))
- goto_bad;
-
/* Move required pools across */
if (!(_move_thins(vg_from, vg_to)))
goto_bad;
+ /* Move required cache LVs across */
if (!(_move_cache(vg_from, vg_to)))
goto_bad;
+ /* Move required snapshots across */
+ if (!(_move_snapshots(vg_from, vg_to)))
+ goto_bad;
+
/* Split metadata areas and check if both vgs have at least one area */
if (!(vg_split_mdas(cmd, vg_from, vg_to)) && vg_from->pv_count) {
log_error("Cannot split: Nowhere to store metadata for new Volume Group");
7 years, 10 months
master - libdm: cast walk flags to uint64_t when logging.
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4d4f48af9f18b9...
Commit: 4d4f48af9f18b9407c065cdc035cf8e397e08ac0
Parent: f1dd0258f1cb27e62d1133ba41c75bca04a7b174
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Tue Jul 5 20:45:24 2016 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Tue Jul 5 20:45:24 2016 +0100
libdm: cast walk flags to uint64_t when logging.
Walk flags are ULL constants; cast the result to a uint64_t before
logging with a FMTx64 format specifier to avoid a compiler warning:
warning: format ���%lx��� expects argument of type ���long unsigned int���,
but argument 5 has type ���long long unsigned int���
---
libdm/libdm-stats.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index 83c4d50..07503a5 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -1399,7 +1399,7 @@ int dm_stats_walk_init(struct dm_stats *dms, uint64_t flags)
if (flags & ~DM_STATS_WALK_MASK) {
log_error("Unknown value in walk flags: 0x" FMTx64,
- flags & ~DM_STATS_WALK_MASK);
+ (uint64_t) (flags & ~DM_STATS_WALK_MASK));
return 0;
}
dms->walk_flags = flags;
7 years, 10 months
master - libdm: ensure flags constants have ULL suffix
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f1dd0258f1cb27...
Commit: f1dd0258f1cb27e62d1133ba41c75bca04a7b174
Parent: 93034d0b695a72deebe51b3eb7075366728ba0f7
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Tue Jul 5 20:21:49 2016 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Tue Jul 5 20:21:49 2016 +0100
libdm: ensure flags constants have ULL suffix
The walk flags used by libdm-stats use the upper portion of a 64b
value: use the ULL suffix to ensure the compiler knows the expected
size.
---
libdm/libdevmapper.h | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index e769be2..415928c 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -1010,11 +1010,11 @@ typedef enum {
* the resulting walk will visit instance of each type specified by
* the flag combination.
*/
-#define DM_STATS_WALK_AREA 0x1000000000000
-#define DM_STATS_WALK_REGION 0x2000000000000
-#define DM_STATS_WALK_GROUP 0x4000000000000
+#define DM_STATS_WALK_AREA 0x1000000000000ULL
+#define DM_STATS_WALK_REGION 0x2000000000000ULL
+#define DM_STATS_WALK_GROUP 0x4000000000000ULL
-#define DM_STATS_WALK_ALL 0x7000000000000
+#define DM_STATS_WALK_ALL 0x7000000000000ULL
#define DM_STATS_WALK_DEFAULT (DM_STATS_WALK_AREA | DM_STATS_WALK_REGION)
/*
@@ -1024,7 +1024,7 @@ typedef enum {
* suppress these duplicate entries during a dm_stats_walk_* with the
* DM_STATS_WALK_REGION flag set.
*/
-#define DM_STATS_WALK_SKIP_SINGLE_AREA 0x8000000000000
+#define DM_STATS_WALK_SKIP_SINGLE_AREA 0x8000000000000ULL
/*
* Initialise the cursor control of a dm_stats handle for the specified
7 years, 10 months
master - doc: document --area, --region, and --group in dmstats.8.in
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=93034d0b695a72...
Commit: 93034d0b695a72deebe51b3eb7075366728ba0f7
Parent: e9c6fd3cff806344f1d32bc16daadd732d0acef6
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Tue Jul 5 19:28:19 2016 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Tue Jul 5 19:53:17 2016 +0100
doc: document --area, --region, and --group in dmstats.8.in
---
man/dmstats.8.in | 42 ++++++++++++++++++++++++++++++++++--------
1 files changed, 34 insertions(+), 8 deletions(-)
diff --git a/man/dmstats.8.in b/man/dmstats.8.in
index 8530cae..6bbcc63 100644
--- a/man/dmstats.8.in
+++ b/man/dmstats.8.in
@@ -9,6 +9,11 @@
. RB \%[ \-\-allregions | \-\-regionid
. IR id ]
..
+.de OPT_OBJECTS
+. RB [ \-\-area ]
+. RB [ \-\-region ]
+. RB [ \-\-group ]
+..
.
.\" Print units suffix, use with arg to print human
.\" man2html can't handle too many changes per command
@@ -144,6 +149,7 @@ dmstats \(em device-mapper statistics management
. IR type_list ]
. RB [ \-\-units
. IR units ]
+. OPT_OBJECTS
. RB \%[ \-\-nosuffix ]
. RB [ \-\-notimesuffix ]
. RB \%[ \-v | \-\-verbose [ \-v | \-\-verbose ]]
@@ -179,6 +185,7 @@ dmstats \(em device-mapper statistics management
. RB [ \-\-histogram ]
. OPT_PROGRAMS
. OPT_REGIONS
+. OPT_OBJECTS
. RB [ \-O | \-\-sort
. IR sort_fields ]
. RB [ \-S | \-\-select
@@ -252,6 +259,12 @@ Include all present regions for commands that normally accept a single
region identifier.
.
.HP
+.BR \-\-area
+.br
+When peforming a list or report, include objects of type area in the
+results.
+.
+.HP
.BR \-\-areas
.IR nr_areas
.br
@@ -268,14 +281,6 @@ optional suffix selects units of:
.HELP_UNITS
.
.HP
-.BR \-\-userdata
-.IR user_data
-.br
-Specify user data (a word) to be stored with a new region. The value
-is added to any internal auxilliary data (for example, group
-information), and stored with the region in the aux_data field provided
-by the kernel. Whitespace is not permitted.
-.HP
.BR \-\-clear
.br
When printing statistics counters, also atomically reset them to zero.
@@ -288,6 +293,12 @@ Specify the iteration count for repeating reports. If the count
argument is zero reports will continue to repeat until interrupted.
.
.HP
+.BR \-\-group
+.br
+When peforming a list or report, include objects of type group in the
+results.
+.
+.HP
.BR \-\-groupid
.IR id
.br
@@ -384,6 +395,12 @@ program ID in order to select only regions with a matching value. The
default program ID for dmstats-managed regions is "dmstats".
.
.HP
+.BR \-\-region
+.br
+When peforming a list or report, include objects of type region in the
+results.
+.
+.HP
.BR \-\-regionid
.IR id
.br
@@ -457,6 +474,15 @@ All sizes are output in these units:
Can also specify custom units e.g. \fB\-\-units\ 3M\fP.
.
.HP
+.BR \-\-userdata
+.IR user_data
+.br
+Specify user data (a word) to be stored with a new region. The value
+is added to any internal auxilliary data (for example, group
+information), and stored with the region in the aux_data field provided
+by the kernel. Whitespace is not permitted.
+.
+.HP
.BR \-u | \-\-uuid
.br
Specify the uuid.
7 years, 10 months
master - dmstats: rename 'aux_data' to 'user_data'
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=14b74c360f22c2...
Commit: 14b74c360f22c21ca54b04c7520ef50109132bd1
Parent: fef4832a8509560293409a254c6a4e2ef39deb27
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Tue Jul 5 15:30:31 2016 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Tue Jul 5 19:53:17 2016 +0100
dmstats: rename 'aux_data' to 'user_data'
Make it clear that the "aux data" presented in reports is the user
data stored in the field (and does not include any library-internal
state such as group descriptors) by renaming the field to user_data
and changing the heading to "UserData".
---
man/dmstats.8.in | 16 +++++++++-------
tools/dmsetup.c | 26 +++++++++++++-------------
2 files changed, 22 insertions(+), 20 deletions(-)
diff --git a/man/dmstats.8.in b/man/dmstats.8.in
index 5d8e910..2175097 100644
--- a/man/dmstats.8.in
+++ b/man/dmstats.8.in
@@ -271,8 +271,10 @@ optional suffix selects units of:
.BR \-\-auxdata
.IR aux_data
.br
-Specify auxilliary data (a string) to be stored with a new region.
-.
+Specify user data (a word) to be stored with a new region. The value
+is added to any internal auxilliary data (for example, group
+information), and stored with the region in the aux_data field provided
+by the kernel. Whitespace is not permitted.
.HP
.BR \-\-clear
.br
@@ -501,9 +503,9 @@ one milisecond can only be used when precise timestamps are enabled: if
\fB\-\-precise\fP is not given and values less than one milisecond are
used it will be enabled automatically.
-An optional \fBprogram_id\fP or \fBaux_data\fP string may be associated
+An optional \fBprogram_id\fP or \fBuser_data\fP string may be associated
with the region. A \fBprogram_id\fP may then be used to select regions
-for subsequent list, print, and report operations. The \fBaux_data\fP
+for subsequent list, print, and report operations. The \fBuser_data\fP
stores an arbitrary string and is not used by dmstats or the
device-mapper kernel statistics subsystem.
@@ -724,7 +726,7 @@ when this value is close to 100%.
Meta fields provide information about the groups, regions, or areas that
the statistics values relate to. This includes the region and area
identifier, start, length, and counts, as well as the program ID and
-auxiliary data values.
+user data values.
.TP
.B region_id
Region identifier. This is a non-negative integer returned by the kernel
@@ -761,8 +763,8 @@ The number of areas in this region.
.B program_id
The program ID value associated with this region.
.TP
-.B aux_data
-The auxiliary data value associated with this region.
+.B user_data
+The user data value associated with this region.
.TP
.B group_id
Group identifier. This is a non-negative integer returned by the dmstats
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index d48e423..b468fee 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -3482,16 +3482,16 @@ static int _dm_stats_program_id_disp(struct dm_report *rh,
return dm_report_field_string(rh, field, (const char * const *) &program_id);
}
-static int _dm_stats_aux_data_disp(struct dm_report *rh,
- struct dm_pool *mem __attribute__((unused)),
- struct dm_report_field *field, const void *data,
- void *private __attribute__((unused)))
+static int _dm_stats_user_data_disp(struct dm_report *rh,
+ struct dm_pool *mem __attribute__((unused)),
+ struct dm_report_field *field, const void *data,
+ void *private __attribute__((unused)))
{
const struct dm_stats *dms = (const struct dm_stats *) data;
- const char *aux_data;
- if (!(aux_data = dm_stats_get_current_region_aux_data(dms)))
+ const char *user_data;
+ if (!(user_data = dm_stats_get_current_region_aux_data(dms)))
return_0;
- return dm_report_field_string(rh, field, (const char * const *) &aux_data);
+ return dm_report_field_string(rh, field, (const char * const *) &user_data);
}
static int _dm_stats_name_disp(struct dm_report *rh,
@@ -4280,7 +4280,7 @@ FIELD_F(STATS_META, SIZ, "ArOff", 5, dm_stats_area_offset, "area_offset", "Area
FIELD_F(STATS_META, NUM, "#Areas", 6, dm_stats_area_count, "area_count", "Area count.")
FIELD_F(STATS_META, NUM, "GrpID", 5, dm_stats_group_id, "group_id", "Group ID.")
FIELD_F(STATS_META, STR, "ProgID", 6, dm_stats_program_id, "program_id", "Program ID.")
-FIELD_F(STATS_META, STR, "AuxDat", 6, dm_stats_aux_data, "aux_data", "Auxiliary data.")
+FIELD_F(STATS_META, STR, "UserData", 8, dm_stats_user_data, "user_data", "Auxiliary data.")
FIELD_F(STATS_META, STR, "Precise", 7, dm_stats_precise, "precise", "Set if nanosecond precision counters are enabled.")
FIELD_F(STATS_META, STR, "#Bins", 9, dm_stats_hist_bins, "hist_bins", "The number of histogram bins configured.")
FIELD_F(STATS_META, STR, "Histogram Bounds", 16, dm_stats_hist_bounds, "hist_bounds", "Latency histogram bin boundaries.")
@@ -4760,7 +4760,7 @@ static int _do_stats_create_regions(struct dm_stats *dms,
uint64_t len, int64_t step,
int segments,
const char *program_id,
- const char *aux_data)
+ const char *user_data)
{
uint64_t this_start = 0, this_len = len, region_id = UINT64_C(0);
const char *devname = NULL, *histogram = _string_args[BOUNDS_ARG];
@@ -4821,7 +4821,7 @@ static int _do_stats_create_regions(struct dm_stats *dms,
if (!dm_stats_create_region(dms, ®ion_id,
this_start, this_len, step,
precise, bounds,
- program_id, aux_data)) {
+ program_id, user_data)) {
log_error("%s: Could not create statistics region.",
devname);
goto out;
@@ -4844,7 +4844,7 @@ out:
static int _stats_create(CMD_ARGS)
{
struct dm_stats *dms;
- const char *name, *aux_data = "", *program_id = DM_STATS_PROGRAM_ID;
+ const char *name, *user_data = "", *program_id = DM_STATS_PROGRAM_ID;
uint64_t start = 0, len = 0, areas = 0, area_size = 0;
int64_t step = 0;
@@ -4926,7 +4926,7 @@ static int _stats_create(CMD_ARGS)
program_id = DM_STATS_PROGRAM_ID;
if (_switches[AUX_DATA_ARG])
- aux_data = _string_args[AUX_DATA_ARG];
+ user_data = _string_args[AUX_DATA_ARG];
if (!(dms = dm_stats_create(DM_STATS_PROGRAM_ID)))
return_0;
@@ -4956,7 +4956,7 @@ static int _stats_create(CMD_ARGS)
return _do_stats_create_regions(dms, name, start, len, step,
_switches[SEGMENTS_ARG],
- program_id, aux_data);
+ program_id, user_data);
bad:
dm_stats_destroy(dms);
7 years, 10 months
master - dmstats: add 'statsname' and 'obj_type' to default stats fields
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b926511b4b53b7...
Commit: b926511b4b53b7240213845457dfb54649c38899
Parent: 0b05e4a874b3398271dbbad5f5d7a72e15eadfce
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Tue Jul 5 12:29:13 2016 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Tue Jul 5 19:53:17 2016 +0100
dmstats: add 'statsname' and 'obj_type' to default stats fields
---
tools/dmsetup.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index c543972..e0cade0 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -4312,7 +4312,7 @@ static const char *splitname_report_options = "vg_name,lv_name,lv_layer";
"await,read_await,write_await"
/* Device, region and area metadata. */
-#define STATS_DEV_INFO "statsname,group_id,region_id"
+#define STATS_DEV_INFO "statsname,group_id,region_id,obj_type"
#define STATS_AREA_INFO "area_id,area_start,area_len"
#define STATS_AREA_INFO_FULL STATS_DEV_INFO ",region_start,region_len,area_count,area_id,area_start,area_len"
#define STATS_REGION_INFO STATS_DEV_INFO ",region_start,region_len,area_count,area_len"
7 years, 10 months
master - dmstats: convert 'delete' to dm_stats_foreach_region()
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b0964acadf47ac...
Commit: b0964acadf47aca1769138607338c5ea56570398
Parent: 01cc11d9f85dc624ee2536120d7e1e1fabeadbe5
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Tue Jul 5 11:26:24 2016 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Tue Jul 5 19:53:16 2016 +0100
dmstats: convert 'delete' to dm_stats_foreach_region()
---
tools/dmsetup.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 9d3d0a5..6900ba2 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -5029,16 +5029,14 @@ static int _stats_delete(CMD_ARGS)
goto out;
}
} else if (_switches[ALL_REGIONS_ARG]) {
- dm_stats_walk_init(dms, DM_STATS_WALK_REGION);
- dm_stats_walk_do(dms) {
+ dm_stats_foreach_region(dms) {
region_id = dm_stats_get_current_region(dms);
if (!dm_stats_delete_region(dms, region_id)) {
log_error("Could not delete statistics region.");
goto out;
}
log_info("Deleted statistics region %" PRIu64, region_id);
- dm_stats_walk_next(dms);
- } dm_stats_walk_while(dms);
+ }
} else {
dm_stats_delete_region(dms, region_id);
log_info("Deleted statistics region " FMTu64 ".\n", region_id);
7 years, 10 months
master - dmstats: convert 'print' to dm_stats_foreach_region()
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=01cc11d9f85dc6...
Commit: 01cc11d9f85dc624ee2536120d7e1e1fabeadbe5
Parent: 2047b8e5658a0f6816d2e940b82e1684b5698aa6
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Tue Jul 5 11:09:38 2016 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Tue Jul 5 19:53:16 2016 +0100
dmstats: convert 'print' to dm_stats_foreach_region()
---
tools/dmsetup.c | 43 +++++++++++++++++++++++++++++--------------
1 files changed, 29 insertions(+), 14 deletions(-)
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index c121f45..9d3d0a5 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -5051,6 +5051,23 @@ out:
return r;
}
+static int _stats_print_one_region(struct dm_stats *dms, int clear,
+ uint64_t region_id)
+{
+ char *stbuff = NULL;
+
+ /*FIXME: line control for large regions */
+ if (!(stbuff = dm_stats_print_region(dms, region_id, 0, 0, clear))) {
+ log_error("Could not print statistics region.");
+ return 0;
+ }
+
+ printf("%s", stbuff);
+ dm_stats_buffer_destroy(dms, stbuff);
+
+ return 1;
+}
+
static int _stats_print(CMD_ARGS)
{
struct dm_stats *dms;
@@ -5079,8 +5096,6 @@ static int _stats_print(CMD_ARGS)
name = argv[0];
}
- region_id = (uint64_t) _int_args[REGION_ID_ARG];
-
if (!(dms = dm_stats_create(DM_STATS_PROGRAM_ID)))
return_0;
@@ -5095,15 +5110,18 @@ static int _stats_print(CMD_ARGS)
goto out;
}
- dm_stats_walk_init(dms, DM_STATS_WALK_REGION);
- dm_stats_walk_do(dms) {
- if (_switches[ALL_REGIONS_ARG])
- region_id = dm_stats_get_current_region(dms);
+ if (!allregions) {
+ region_id = (uint64_t) _int_args[REGION_ID_ARG];
+ if (!_stats_print_one_region(dms, clear, region_id))
+ goto_out;
+ r = 1;
+ goto out;
+ }
- if (!dm_stats_region_present(dms, region_id)) {
- log_error("No such region: %"PRIu64".", region_id);
- goto out;
- }
+ dm_stats_foreach_region(dms) {
+ region_id = dm_stats_get_current_region(dms);
+ if (!_stats_print_one_region(dms, clear, region_id))
+ goto_out;
/*FIXME: line control for large regions */
if (!(stbuff = dm_stats_print_region(dms, region_id, 0, 0, clear))) {
@@ -5112,11 +5130,8 @@ static int _stats_print(CMD_ARGS)
}
printf("%s", stbuff);
-
dm_stats_buffer_destroy(dms, stbuff);
- dm_stats_walk_next(dms);
-
- } dm_stats_walk_while(dms);
+ }
r = 1;
7 years, 10 months
master - dmstats: report a list of members as a group's region_id
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a2bf3c6ee8ae6e...
Commit: a2bf3c6ee8ae6e03bd1351e59f1a097c92205dec
Parent: ca0a4cececf372a5d420e9402fec86d5cd013bf5
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Sun Jun 19 21:01:50 2016 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Tue Jul 5 19:53:16 2016 +0100
dmstats: report a list of members as a group's region_id
Instead of '-' print the member list in range notation (as stored
in aux_data).
---
tools/dmsetup.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index d1f93fd..ae04c9d 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -3264,11 +3264,16 @@ static int _dm_stats_region_id_disp(struct dm_report *rh,
void *private __attribute__((unused)))
{
const struct dm_stats *dms = (const struct dm_stats *) data;
- uint64_t region_id = dm_stats_get_current_region(dms);
+ uint64_t group_id, region_id = dm_stats_get_current_region(dms);
+ char *group_buf = NULL, *repstr;
if (dm_stats_current_object_type(dms) == DM_STATS_OBJECT_TYPE_GROUP) {
- /* FIXME: output group region list and use group_id as sortval. */
- dm_report_field_set_value(field, "-", ®ion_id);
+ group_id = dm_stats_get_group_id(dms, dm_stats_get_current_region(dms));
+ if (!dm_stats_get_group_descriptor(dms, group_id, &group_buf))
+ return 0;
+ /* group_buf will disappear with the current handle */
+ repstr = dm_pool_strdup(mem, group_buf);
+ dm_report_field_set_value(field, repstr, &group_id);
return 1;
}
7 years, 10 months