Implement a function to return the last segment in a LV.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Version 2.02.89 -
==================================
+ Add last_seg(lv) internal function.
Support empty string for log/prefix.
Fix regression that allowed mirrored logs for cluster mirrors.
Don't print char type[8] as a plain string in pvck PV type.
const char *pvid);
/* Find LV segment containing given LE */
struct lv_segment *first_seg(const struct logical_volume *lv);
+struct lv_segment *last_seg(const struct logical_volume *lv);
/*
return NULL;
}
+struct lv_segment *last_seg(const struct logical_volume *lv)
+{
+ struct lv_segment *seg;
+
+ dm_list_iterate_back_items(seg, &lv->segments)
+ return seg;
+
+ return NULL;
+}
+
int vg_remove_mdas(struct volume_group *vg)
{
struct metadata_area *mda;