]> sourceware.org Git - lvm2.git/commitdiff
Add last_seg
authorZdenek Kabelac <zkabelac@redhat.com>
Fri, 28 Oct 2011 20:12:54 +0000 (20:12 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Fri, 28 Oct 2011 20:12:54 +0000 (20:12 +0000)
Implement a function to return the last segment in a LV.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
WHATS_NEW
lib/metadata/metadata-exported.h
lib/metadata/metadata.c

index 92d3319920e21ff52f9873697051c2a40eda0ad5..02ef70098b6e60d4050d98a7e2a87d723de7b970 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 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.
index c65fc8466c534f47d57f5a982bfab8a8cbafcf24..734cd061dc7596f2ab42158dc2b352d694d82891 100644 (file)
@@ -660,6 +660,7 @@ const char *find_vgname_from_pvid(struct cmd_context *cmd,
                                  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);
 
 
 /*
index bfdde8f52defa7126386f01573372c58ad34ec03..21ff001bacc1f5c56d5a9b14713595787fd6d285 100644 (file)
@@ -1906,6 +1906,16 @@ struct lv_segment *first_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;
This page took 0.051263 seconds and 5 git commands to generate.