summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Rockai <prockai@redhat.com>2013-07-29 19:14:10 +0200
committerPetr Rockai <prockai@redhat.com>2013-11-17 21:43:06 +0100
commit99214c51eb815806c4a4a4711fa3562546479751 (patch)
treeb31701c444a682d217d37d14cb34d2f8e6f07dd3
parentb07fb3a6415215bf7e6128516a210b07376753dc (diff)
downloadlvm2-99214c51eb815806c4a4a4711fa3562546479751.tar.gz
report: Make PMdaFree into a "label" field.
-rw-r--r--lib/report/columns.h2
-rw-r--r--lib/report/report.c5
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/report/columns.h b/lib/report/columns.h
index 27f4d7ff1..8a87d11a7 100644
--- a/lib/report/columns.h
+++ b/lib/report/columns.h
@@ -67,10 +67,10 @@ FIELD(LVS, lv, STR, "Host", lvid, 10, lvhost, lv_host, "Creation host of the LV,
FIELD(LVS, lv, STR, "Modules", lvid, 7, modules, lv_modules, "Kernel device-mapper modules required for this LV.", 0)
FIELD(LABEL, pv, STR, "PV UUID", id, 38, uuid, pv_uuid, "Unique identifier.", 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, STR, "Fmt", type, 3, pvfmt, pv_fmt, "Type of metadata.", 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, label, NUM, "PMdaFree", type, 9, pvmdafree, pv_mda_free, "Free metadata area space on this device in current units.", 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 94e523075..3f716b5c6 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -791,9 +791,8 @@ static int _pvmdafree_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 freespace = pv_mda_free(pv);
+ const struct label *label = (const struct label *) data;
+ uint64_t freespace = lvmcache_info_mda_free(label->info);
return _size64_disp(rh, mem, field, &freespace, private);
}