1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

Add last_seg

Implement a function to return the last segment in a LV.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
This commit is contained in:
Zdenek Kabelac 2011-10-28 20:12:54 +00:00
parent 69359fcc6a
commit 7aa87822f7
3 changed files with 12 additions and 0 deletions

View File

@ -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.

View 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);
/*

View 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;