From: Dave Wysochanski Date: Mon, 11 May 2009 09:01:27 -0400 Subject: [PATCH 14/30] Update pe_start field - create pestart_disp which calls liblvm 'get' function. In-Reply-To: <1242046903-15133-14-git-send-email-dwysocha@redhat.com> References: <1242046903-15133-1-git-send-email-dwysocha@redhat.com> <1242046903-15133-2-git-send-email-dwysocha@redhat.com> <1242046903-15133-3-git-send-email-dwysocha@redhat.com> <1242046903-15133-4-git-send-email-dwysocha@redhat.com> <1242046903-15133-5-git-send-email-dwysocha@redhat.com> <1242046903-15133-6-git-send-email-dwysocha@redhat.com> <1242046903-15133-7-git-send-email-dwysocha@redhat.com> <1242046903-15133-8-git-send-email-dwysocha@redhat.com> <1242046903-15133-9-git-send-email-dwysocha@redhat.com> <1242046903-15133-10-git-send-email-dwysocha@redhat.com> <1242046903-15133-11-git-send-email-dwysocha@redhat.com> <1242046903-15133-12-git-send-email-dwysocha@redhat.com> <1242046903-15133-13-git-send-email-dwysocha@redhat.com> <1242046903-15133-14-git-send-email-dwysocha@redhat.com> Message-ID: <1242046903-15133-15-git-send-email-dwysocha@redhat.com> List-Id: To: lvm-devel@redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Note that the liblvm 'get' function was one of the autogenerated ones (simple field dereference). Should be no functional change. Signed-off-by: Dave Wysochanski --- lib/report/columns.h | 2 +- lib/report/report.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletions(-) diff --git a/lib/report/columns.h b/lib/report/columns.h index fc79d62..22b6ee0 100644 --- a/lib/report/columns.h +++ b/lib/report/columns.h @@ -84,7 +84,7 @@ FIELD(LABEL, pv, STR, "PV", dev, 10, dev_name, "pv_name", "Name.") FIELD(LABEL, pv, NUM, "PMdaFree", id, 9, pvmdafree, "pv_mda_free", "Free metadata area space on this device in current units.") FIELD(LABEL, pv, NUM, "PMdaSize", id, 9, pvmdasize, "pv_mda_size", "Size of smallest metadata area on this device in current units.") -FIELD(PVS, pv, NUM, "1st PE", pe_start, 7, size64, "pe_start", "Offset to the start of data on the underlying device.") +FIELD(PVS, pv, NUM, "1st PE", id, 7, pestart, "pe_start", "Offset to the start of data on the underlying device.") FIELD(PVS, pv, NUM, "PSize", id, 5, pvsize, "pv_size", "Size of PV in current units.") FIELD(PVS, pv, NUM, "PFree", id, 5, pvfree, "pv_free", "Total amount of unallocated space in current units.") FIELD(PVS, pv, NUM, "Used", id, 4, pvused, "pv_used", "Total amount of allocated space in current units.") diff --git a/lib/report/report.c b/lib/report/report.c index da694a5..fc54f96 100644 --- a/lib/report/report.c +++ b/lib/report/report.c @@ -812,6 +812,19 @@ static int _pvfree_disp(struct dm_report *rh, struct dm_pool *mem, return _size64_disp(rh, mem, field, &freespace, private); } +static int _pestart_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 value; + + value = lvm_pv_get_pe_start(pv); + + return _size64_disp(rh, mem, field, &value, private); +} + static int _pvsize_disp(struct dm_report *rh, struct dm_pool *mem, struct dm_report_field *field, const void *data, void *private) -- 1.6.0.6