From: Dave Wysochanski Date: Mon, 11 May 2009 09:01:43 -0400 Subject: [PATCH 30/30] Update pvseg_start and pvseg_size fields to have a disp function calling liblvm In-Reply-To: <1242046903-15133-30-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> <1242046903-15133-15-git-send-email-dwysocha@redhat.com> <1242046903-15133-16-git-send-email-dwysocha@redhat.com> <1242046903-15133-17-git-send-email-dwysocha@redhat.com> <1242046903-15133-18-git-send-email-dwysocha@redhat.com> <1242046903-15133-19-git-send-email-dwysocha@redhat.com> <1242046903-15133-20-git-send-email-dwysocha@redhat.com> <1242046903-15133-21-git-send-email-dwysocha@redhat.com> <1242046903-15133-22-git-send-email-dwysocha@redhat.com> <1242046903-15133-23-git-send-email-dwysocha@redhat.com> <1242046903-15133-24-git-send-email-dwysocha@redhat.com> <1242046903-15133-25-git-send-email-dwysocha@redhat.com> <1242046903-15133-26-git-send-email-dwysocha@redhat.com> <1242046903-15133-27-git-send-email-dwysocha@redhat.com> <1242046903-15133-28-git-send-email-dwysocha@redhat.com> <1242046903-15133-29-git-send-email-dwysocha@redhat.com> <1242046903-15133-30-git-send-email-dwysocha@redhat.com> Message-ID: <1242046903-15133-31-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 Call into liblvm 'get' functions from 'disp' functions. Note that the 'get' functions were some of the simple ones autogenerated by the perl script in an earlier patch. Should be no functional change. Signed-off-by: Dave Wysochanski --- lib/report/columns.h | 4 ++-- lib/report/report.c | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/lib/report/columns.h b/lib/report/columns.h index c4463cf..c3ae040 100644 --- a/lib/report/columns.h +++ b/lib/report/columns.h @@ -130,6 +130,6 @@ FIELD(SEGS, seg, STR, "Seg Tags", tags, 8, tags, "seg_tags", "Tags, if any.") FIELD(SEGS, seg, STR, "PE Ranges", list, 9, peranges, "seg_pe_ranges", "Ranges of Physical Extents of underlying devices in command line format.") FIELD(SEGS, seg, STR, "Devices", list, 7, devices, "devices", "Underlying devices used with starting extent numbers.") -FIELD(PVSEGS, pvseg, NUM, "Start", pe, 5, uint32, "pvseg_start", "Physical Extent number of start of segment.") -FIELD(PVSEGS, pvseg, NUM, "SSize", len, 5, uint32, "pvseg_size", "Number of extents in segment.") +FIELD(PVSEGS, pvseg, NUM, "Start", list, 5, pvsegstart, "pvseg_start", "Physical Extent number of start of segment.") +FIELD(PVSEGS, pvseg, NUM, "SSize", list, 5, pvsegsize, "pvseg_size", "Number of extents in segment.") /* *INDENT-ON* */ diff --git a/lib/report/report.c b/lib/report/report.c index e91cef2..968c798 100644 --- a/lib/report/report.c +++ b/lib/report/report.c @@ -811,6 +811,30 @@ static int _chunksize_disp(struct dm_report *rh, struct dm_pool *mem, return _size64_disp(rh, mem, field, &size, private); } +static int _pvsegstart_disp(struct dm_report *rh, struct dm_pool *mem, + struct dm_report_field *field, + const void *data, void *private) +{ + const struct pv_segment *pvseg = (const struct pv_segment *) data; + uint32_t start; + + start = lvm_pvseg_get_start(pvseg); + + return _uint32_disp(rh, mem, field, &start, private); +} + +static int _pvsegsize_disp(struct dm_report *rh, struct dm_pool *mem, + struct dm_report_field *field, + const void *data, void *private) +{ + const struct pv_segment *pvseg = (const struct pv_segment *) data; + uint32_t value; + + value = lvm_pvseg_get_size(pvseg); + + return _uint32_disp(rh, mem, field, &value, private); +} + static int _originsize_disp(struct dm_report *rh, struct dm_pool *mem, struct dm_report_field *field, const void *data, void *private) -- 1.6.0.6