mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
abstract _is_contiguous()
This commit is contained in:
parent
b4ccb00b36
commit
7dce16f234
@ -732,6 +732,20 @@ static int _comp_area(const void *l, const void *r)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Is PV area contiguous to PV segment?
|
||||||
|
*/
|
||||||
|
static int _is_contiguous(struct pv_segment *pvseg, struct pv_area *pva)
|
||||||
|
{
|
||||||
|
if (pvseg->pv != pva->map->pv)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (pvseg->pe + pvseg->len != pva->start)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Is pva contiguous to any existing areas or on the same PV?
|
* Is pva contiguous to any existing areas or on the same PV?
|
||||||
*/
|
*/
|
||||||
@ -755,10 +769,7 @@ static int _check_contiguous(struct lv_segment *prev_lvseg, struct pv_area *pva,
|
|||||||
if (!(prev_pvseg = seg_pvseg(prev_lvseg, s)))
|
if (!(prev_pvseg = seg_pvseg(prev_lvseg, s)))
|
||||||
continue; /* FIXME Broken */
|
continue; /* FIXME Broken */
|
||||||
|
|
||||||
if ((prev_pvseg->pv != pva->map->pv))
|
if (_is_contiguous(prev_pvseg, pva)) {
|
||||||
continue;
|
|
||||||
|
|
||||||
if (prev_pvseg->pe + prev_pvseg->len == pva->start) {
|
|
||||||
areas[s] = pva;
|
areas[s] = pva;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user