1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

cleanup: use last_seg

Use function to obtain last segment type.
This commit is contained in:
Zdenek Kabelac 2013-05-22 15:04:51 +02:00
parent 8cbacd2474
commit 58a2e5e2df

View File

@ -558,9 +558,7 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg,
seg_size = lp->extents - lv->le_count;
/* Use segment type of last segment */
dm_list_iterate_items(seg, &lv->segments) {
lp->segtype = seg->segtype;
}
lp->segtype = last_seg(lv)->segtype;
/* FIXME Support LVs with mixed segment types */
if (lp->segtype != get_segtype_from_string(cmd, arg_str_value(cmd, type_ARG,