mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Add pvseg_is_allocated() for identifying a PV segment allocated to a LV.
This commit is contained in:
parent
43aa463780
commit
052bbfba3a
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.34 -
|
Version 2.02.34 -
|
||||||
===================================
|
===================================
|
||||||
|
Add pvseg_is_allocated() for identifying a PV segment allocated to a LV.
|
||||||
Add list_move() for moving elements from one list to another.
|
Add list_move() for moving elements from one list to another.
|
||||||
Add 'is_reserved_lvname()' for identifying hidden LVs.
|
Add 'is_reserved_lvname()' for identifying hidden LVs.
|
||||||
Correct command name in lvmdiskscan man page.
|
Correct command name in lvmdiskscan man page.
|
||||||
|
@ -270,7 +270,7 @@ void pvdisplay_segments(const struct physical_volume *pv)
|
|||||||
log_print("Physical extent %u to %u:",
|
log_print("Physical extent %u to %u:",
|
||||||
pvseg->pe, pvseg->pe + pvseg->len - 1);
|
pvseg->pe, pvseg->pe + pvseg->len - 1);
|
||||||
|
|
||||||
if (pvseg->lvseg) {
|
if (pvseg_is_allocated(pvseg)) {
|
||||||
log_print(" Logical volume\t%s%s/%s",
|
log_print(" Logical volume\t%s%s/%s",
|
||||||
pvseg->lvseg->lv->vg->cmd->dev_dir,
|
pvseg->lvseg->lv->vg->cmd->dev_dir,
|
||||||
pvseg->lvseg->lv->vg->name,
|
pvseg->lvseg->lv->vg->name,
|
||||||
|
@ -151,6 +151,8 @@ struct pv_segment {
|
|||||||
uint32_t lv_area; /* Index to area in LV segment */
|
uint32_t lv_area; /* Index to area in LV segment */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define pvseg_is_allocated(pvseg) ((pvseg)->lvseg)
|
||||||
|
|
||||||
struct physical_volume {
|
struct physical_volume {
|
||||||
struct id id;
|
struct id id;
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
|
@ -612,7 +612,7 @@ int vg_change_pesize(struct cmd_context *cmd __attribute((unused)),
|
|||||||
|
|
||||||
/* foreach free PV Segment */
|
/* foreach free PV Segment */
|
||||||
list_iterate_items(pvseg, &pv->segments) {
|
list_iterate_items(pvseg, &pv->segments) {
|
||||||
if (pvseg->lvseg)
|
if (pvseg_is_allocated(pvseg))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!_recalc_extents(&pvseg->pe, pv_dev_name(pv),
|
if (!_recalc_extents(&pvseg->pe, pv_dev_name(pv),
|
||||||
|
@ -233,7 +233,7 @@ uint32_t pv_list_extents_free(const struct list *pvh)
|
|||||||
list_iterate_items(pvl, pvh) {
|
list_iterate_items(pvl, pvh) {
|
||||||
list_iterate_items(per, pvl->pe_ranges) {
|
list_iterate_items(per, pvl->pe_ranges) {
|
||||||
list_iterate_items(pvseg, &pvl->pv->segments) {
|
list_iterate_items(pvseg, &pvl->pv->segments) {
|
||||||
if (!pvseg->lvseg) /* free space */
|
if (!pvseg_is_allocated(pvseg))
|
||||||
extents += _overlap_pe(pvseg, per);
|
extents += _overlap_pe(pvseg, per);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user