[lvm-devel] [PATCH 28/30] Update segstart_disp and segstartpe_disp to call liblvm 'get' functions.

Dave Wysochanski dwysocha at redhat.com
Mon May 11 13:01:41 UTC 2009


Should be no functional change.

Signed-off-by: Dave Wysochanski <dwysocha at redhat.com>
---
 lib/report/lvm_object_prop.c |    6 ++----
 lib/report/report.c          |    7 +++++--
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/lib/report/lvm_object_prop.c b/lib/report/lvm_object_prop.c
index 6a35122..dc80752 100644
--- a/lib/report/lvm_object_prop.c
+++ b/lib/report/lvm_object_prop.c
@@ -932,8 +932,7 @@ int lvm_lvseg_set_chunk_size(lvseg_t *lvseg, const uint64_t value)
  */
 uint64_t lvm_lvseg_get_start(const lvseg_t *lvseg)
 {
-	/* FIXME: implement function body */
-	return 0;
+	return (uint64_t) lvseg->le * lvseg->lv->vg->extent_size;
 }
 int lvm_lvseg_set_start(lvseg_t *lvseg, const uint64_t value)
 {
@@ -946,8 +945,7 @@ int lvm_lvseg_set_start(lvseg_t *lvseg, const uint64_t value)
  */
 uint64_t lvm_lvseg_get_start_pe(const lvseg_t *lvseg)
 {
-	/* FIXME: implement function body */
-	return 0;
+	return lvseg->le;
 }
 int lvm_lvseg_set_start_pe(lvseg_t *lvseg, const uint64_t value)
 {
diff --git a/lib/report/report.c b/lib/report/report.c
index ece83df..b59e6a1 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -732,7 +732,7 @@ static int _segstart_disp(struct dm_report *rh, struct dm_pool *mem,
 	const struct lv_segment *seg = (const struct lv_segment *) data;
 	uint64_t start;
 
-	start = (uint64_t) seg->le * seg->lv->vg->extent_size;
+	start = lvm_lvseg_get_start(seg);
 
 	return _size64_disp(rh, mem, field, &start, private);
 }
@@ -744,8 +744,11 @@ static int _segstartpe_disp(struct dm_report *rh,
 			    void *private __attribute((unused)))
 {
 	const struct lv_segment *seg = (const struct lv_segment *) data;
+	uint32_t start;
 
-	return dm_report_field_uint32(rh, field, &seg->le);
+	start = lvm_lvseg_get_start_pe(seg);
+
+	return dm_report_field_uint32(rh, field, &start);
 }
 
 static int _segsize_disp(struct dm_report *rh, struct dm_pool *mem,
-- 
1.6.0.6




More information about the lvm-devel mailing list