mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
lvreduce: simplify _lvseg_get_stripes integrity check
Simplify unnecessary loop to avoid coverity complaint.
This commit is contained in:
parent
4cdb178968
commit
0591131a53
@ -5187,7 +5187,7 @@ int lv_extend_policy_calculate_percent(struct logical_volume *lv,
|
|||||||
|
|
||||||
static uint32_t _lvseg_get_stripes(struct lv_segment *seg, uint32_t *stripesize)
|
static uint32_t _lvseg_get_stripes(struct lv_segment *seg, uint32_t *stripesize)
|
||||||
{
|
{
|
||||||
uint32_t s, a;
|
uint32_t s;
|
||||||
struct lv_segment *seg_get, *seg_image, *seg_iorig;
|
struct lv_segment *seg_get, *seg_image, *seg_iorig;
|
||||||
struct logical_volume *lv_image, *lv_iorig;
|
struct logical_volume *lv_image, *lv_iorig;
|
||||||
|
|
||||||
@ -5203,12 +5203,9 @@ static uint32_t _lvseg_get_stripes(struct lv_segment *seg, uint32_t *stripesize)
|
|||||||
|
|
||||||
if (seg_is_integrity(seg_image)) {
|
if (seg_is_integrity(seg_image)) {
|
||||||
/* Get stripe values from the iorig layer. */
|
/* Get stripe values from the iorig layer. */
|
||||||
for (a = 0; a < seg_image->area_count; a++) {
|
lv_iorig = seg_lv(seg_image, 0);
|
||||||
lv_iorig = seg_lv(seg_image, a);
|
seg_iorig = first_seg(lv_iorig);
|
||||||
seg_iorig = first_seg(lv_iorig);
|
seg_get = seg_iorig;
|
||||||
seg_get = seg_iorig;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
/* Get stripe values from the image layer. */
|
/* Get stripe values from the image layer. */
|
||||||
seg_get = seg_image;
|
seg_get = seg_image;
|
||||||
|
Loading…
Reference in New Issue
Block a user