Skip to contentSkip to conversation

master - lv: introduce lvseg_percent_with_info_and_seg_status

PATCH Zdenek Kabelac 1 participant 1 message May 27, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=92eba53a797a011d1ce6fbd7bef88eab41af2072
Commit:        92eba53a797a011d1ce6fbd7bef88eab41af2072
Parent:        f7f395667ee5446e9127fe772deb46f3e4f3812e
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Wed May 25 16:18:38 2016 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Fri May 27 15:47:24 2016 +0200

lv: introduce lvseg_percent_with_info_and_seg_status

Add function to obtain percentage value for cache lv_seg_status. This API is rather evolving 'middle' step as the ultimate goal is segment API fuctionality.

But first we need to be clear at reporting level which values are needed to be reported for which LVs and segments.

---
 WHATS_NEW         |    1 +
 lib/metadata/lv.c |   82 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/metadata/lv.h |    9 ++++++
 3 files changed, 92 insertions(+), 0 deletions(-)
WHATS_NEW +1 -0
index 2265c9b..9f270c6 100644
@@ -1,5 +1,6 @@
 Version 2.02.155 - 
 ================================
+  Add lvseg_percent_with_info_and_seg_status() for percent retrieval.
   Enhance internal seg_status handling to understand snapshots better.
   When refresh failed in suspend, call resume upon error path.
   Support passthrough cache mode when waiting for clean cache.
lib/metadata/lv.c +82 -0

88 lines not on this page · raw message

lib/metadata/lv.h +9 -0
index 08fc090..9f871d6 100644
@@ -197,4 +197,13 @@ char *lv_profile_dup(struct dm_pool *mem, const struct logical_volume *lv);
 char *lv_lock_args_dup(struct dm_pool *mem, const struct logical_volume *lv);
 char *lvseg_kernel_discards_dup_with_info_and_seg_status(struct dm_pool *mem, const struct lv_with_info_and_seg_status *lvdm);
 char *lv_time_dup(struct dm_pool *mem, const struct logical_volume *lv, int iso_mode);
+
+typedef enum {
+	PERCENT_GET_DATA = 0,
+	PERCENT_GET_METADATA,
+	PERCENT_GET_DIRTY
+} percent_get_t;
+dm_percent_t lvseg_percent_with_info_and_seg_status(const struct lv_with_info_and_seg_status *lvdm,
+						    percent_get_t type);
+
 #endif /* _LVM_LV_H */