Skip to contentSkip to conversation

master - lvm2app: fix cache percantage reporting

PATCH Zdenek Kabelac 1 participant 1 message Sep 9, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9350aa72184e08da0faa5f1fda2f245e6342a426
Commit:        9350aa72184e08da0faa5f1fda2f245e6342a426
Parent:        4b22cd81e6b3b60f08976df4104b7411d1af4fc5
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Fri Sep 9 14:25:53 2016 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Fri Sep 9 15:03:28 2016 +0200

lvm2app: fix cache percantage reporting

In lvm2app we were always returning dirty (copy%) value. Return properly data & metadata usage values.

---
 WHATS_NEW               |    1 +
 lib/report/properties.c |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
WHATS_NEW +1 -0
index 9584872..2c47452 100644
@@ -1,5 +1,6 @@
 Version 2.02.166 - 
 =====================================
+  Fix lvm2api reporting of cache data and metadata percent.
   Restore reporting of metadata usage for cache volumes (2.02.155).
   Support raid scrubbing on cache origin LV.
 
lib/report/properties.c +2 -2
index d3feb07..3b27bdc 100644
@@ -114,7 +114,7 @@ static dm_percent_t _data_percent(const struct logical_volume *lv)
 			stack;
 			return DM_PERCENT_INVALID;
 		}
-		percent = status->dirty_usage;
+		percent = status->data_usage;
 		dm_pool_destroy(status->mem);
 		return percent;
 	}
@@ -135,7 +135,7 @@ static dm_percent_t _metadata_percent(const struct logical_volume *lv)
 			stack;
 			return DM_PERCENT_INVALID;
 		}
-		percent = status->dirty_usage;
+		percent = status->metadata_usage;
 		dm_pool_destroy(status->mem);
 		return percent;
 	}