1
0
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:
Dave Wysochanski 2008-03-26 16:48:10 +00:00
parent 43aa463780
commit 052bbfba3a
5 changed files with 6 additions and 3 deletions

View File

@ -1,5 +1,6 @@
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 'is_reserved_lvname()' for identifying hidden LVs.
Correct command name in lvmdiskscan man page.

View File

@ -270,7 +270,7 @@ void pvdisplay_segments(const struct physical_volume *pv)
log_print("Physical extent %u to %u:",
pvseg->pe, pvseg->pe + pvseg->len - 1);
if (pvseg->lvseg) {
if (pvseg_is_allocated(pvseg)) {
log_print(" Logical volume\t%s%s/%s",
pvseg->lvseg->lv->vg->cmd->dev_dir,
pvseg->lvseg->lv->vg->name,

View File

@ -151,6 +151,8 @@ struct pv_segment {
uint32_t lv_area; /* Index to area in LV segment */
};
#define pvseg_is_allocated(pvseg) ((pvseg)->lvseg)
struct physical_volume {
struct id id;
struct device *dev;

View File

@ -612,7 +612,7 @@ int vg_change_pesize(struct cmd_context *cmd __attribute((unused)),
/* foreach free PV Segment */
list_iterate_items(pvseg, &pv->segments) {
if (pvseg->lvseg)
if (pvseg_is_allocated(pvseg))
continue;
if (!_recalc_extents(&pvseg->pe, pv_dev_name(pv),

View File

@ -233,7 +233,7 @@ uint32_t pv_list_extents_free(const struct list *pvh)
list_iterate_items(pvl, pvh) {
list_iterate_items(per, pvl->pe_ranges) {
list_iterate_items(pvseg, &pvl->pv->segments) {
if (!pvseg->lvseg) /* free space */
if (!pvseg_is_allocated(pvseg))
extents += _overlap_pe(pvseg, per);
}
}