From 58a2e5e2df4049108b1ba0fe970fd88eba9a3290 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 22 May 2013 15:04:51 +0200 Subject: [PATCH] cleanup: use last_seg Use function to obtain last segment type. --- tools/lvresize.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/lvresize.c b/tools/lvresize.c index e44fd8233..b679bf9f7 100644 --- a/tools/lvresize.c +++ b/tools/lvresize.c @@ -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,