[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [PATCH 10/30] Update originsize_disp() to call liblvm 'get' function.



Should be no functional change.

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

diff --git a/lib/report/lvm_object_prop.c b/lib/report/lvm_object_prop.c
index 071d9ce..ab8cc9c 100644
--- a/lib/report/lvm_object_prop.c
+++ b/lib/report/lvm_object_prop.c
@@ -187,8 +187,15 @@ int lvm_lv_set_origin(lv_t *lv, const char *value)
  */
 uint64_t lvm_lv_get_origin_size(const lv_t *lv)
 {
-	/* FIXME: implement function body */
-	return 0;
+	uint64_t size;
+
+	if (lv_is_cow(lv))
+		size = (uint64_t) find_cow(lv)->len * lv->vg->extent_size;
+	else if (lv_is_origin(lv))
+		size = lv->size;
+	else
+		size = UINT64_C(0);
+	return size;
 }
 int lvm_lv_set_origin_size(lv_t *lv, const uint64_t value)
 {
diff --git a/lib/report/report.c b/lib/report/report.c
index 78aea9b..85addc9 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -775,12 +775,7 @@ static int _originsize_disp(struct dm_report *rh, struct dm_pool *mem,
 	const struct logical_volume *lv = (const struct logical_volume *) data;
 	uint64_t size;
 
-	if (lv_is_cow(lv))
-		size = (uint64_t) find_cow(lv)->len * lv->vg->extent_size;
-	else if (lv_is_origin(lv))
-		size = lv->size;
-	else
-		size = UINT64_C(0);
+	size = lvm_lv_get_origin_size(lv);
 
 	return _size64_disp(rh, mem, field, &size, private);
 }
-- 
1.6.0.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]