summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Rockai <prockai@redhat.com>2013-07-29 19:05:28 +0200
committerPetr Rockai <prockai@redhat.com>2013-08-28 14:54:32 +0200
commita46c7671b8deec6ddfd90d32253ab0f671e5916e (patch)
treec80d3bab08f315bcac8dd30ed5d7ac31332a87a8
parent887777e3cfe896378329c13551a84b5f5fa02235 (diff)
downloadlvm2-a46c7671b8deec6ddfd90d32253ab0f671e5916e.tar.gz
report: Make dev_size and dev_name columns' type "label".
-rw-r--r--lib/report/columns.h4
-rw-r--r--lib/report/report.c8
2 files changed, 4 insertions, 8 deletions
diff --git a/lib/report/columns.h b/lib/report/columns.h
index 9bb99d389..0da3e70fa 100644
--- a/lib/report/columns.h
+++ b/lib/report/columns.h
@@ -68,9 +68,9 @@ FIELD(LVS, lv, STR, "Modules", lvid, 7, modules, lv_modules, "Kernel device-mapp
FIELD(LABEL, pv, STR, "Fmt", id, 3, pvfmt, pv_fmt, "Type of metadata.", 0)
FIELD(LABEL, pv, STR, "PV UUID", id, 38, uuid, pv_uuid, "Unique identifier.", 0)
-FIELD(LABEL, pv, NUM, "DevSize", id, 7, devsize, dev_size, "Size of underlying device in current units.", 0)
-FIELD(LABEL, pv, STR, "PV", dev, 10, dev_name, pv_name, "Name.", 0)
FIELD(LABEL, pv, NUM, "PMdaFree", id, 9, pvmdafree, pv_mda_free, "Free metadata area space on this device in current units.", 0)
+FIELD(LABEL, label, NUM, "DevSize", dev, 7, devsize, dev_size, "Size of underlying device in current units.", 0)
+FIELD(LABEL, label, STR, "PV", dev, 10, dev_name, pv_name, "Name.", 0)
FIELD(LABEL, pv, NUM, "PMdaSize", id, 9, pvmdasize, pv_mda_size, "Size of smallest metadata area on this device in current units.", 0)
FIELD(PVS, pv, NUM, "1st PE", pe_start, 7, size64, pe_start, "Offset to the start of data on the underlying device.", 0)
diff --git a/lib/report/report.c b/lib/report/report.c
index 77332a23e..6c4caf375 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -672,12 +672,8 @@ static int _devsize_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
const void *data, void *private)
{
- const struct physical_volume *pv =
- (const struct physical_volume *) data;
- uint64_t size;
-
- size = pv_dev_size(pv);
-
+ uint64_t size = 0;
+ dev_get_size(*(const struct device **) data, &size);
return _size64_disp(rh, mem, field, &size, private);
}