1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

o Add ALLOC_SIMPLE

This commit is contained in:
Joe Thornber 2001-11-12 17:55:05 +00:00
parent cf4a4a1fa8
commit 4daacc38cb
3 changed files with 21 additions and 10 deletions

View File

@ -254,10 +254,13 @@ int import_lv(struct pool *mem, struct logical_volume *lv, struct lv_disk *lvd)
if (lvd->lv_badblock)
lv->status |= BADBLOCK_ON;
if (lvd->lv_allocation == LV_STRICT)
if (lvd->lv_allocation & LV_STRICT)
lv->status |= ALLOC_STRICT;
else
if (lvd->lv_allocation & LV_CONTIGUOUS)
lv->status |= ALLOC_CONTIGUOUS;
else
lv->status |= ALLOC_SIMPLE;
lv->read_ahead = lvd->lv_read_ahead;
lv->stripes = lvd->lv_stripes;
@ -314,9 +317,10 @@ void export_lv(struct lv_disk *lvd, struct volume_group *vg,
lvd->lv_badblock = LV_BADBLOCK_ON;
if (lv->status & ALLOC_STRICT)
lvd->lv_allocation = LV_STRICT;
else
lvd->lv_allocation = LV_CONTIGUOUS;
lvd->lv_allocation |= LV_STRICT;
if (lv->status & ALLOC_CONTIGUOUS)
lvd->lv_allocation |= LV_CONTIGUOUS;
}
int import_extents(struct pool *mem, struct volume_group *vg, struct list *pvs)

View File

@ -156,9 +156,15 @@ static int _allocate(struct volume_group *vg, struct logical_volume *lv,
else if (lv->status & ALLOC_CONTIGUOUS)
r = _alloc_contiguous(lv, pvms, allocated);
else
else if (lv->status & ALLOC_SIMPLE)
r = _alloc_simple(lv, pvms, allocated);
else {
log_err("Unknown allocation policy, "
"unable to setup logical volume.");
goto out;
}
if (r) {
vg->free_count -= lv->le_count - allocated;
}

View File

@ -33,10 +33,11 @@
#define CLUSTERED 0x00000400 /* VG */
#define SHARED 0x00000800 /* VG */
#define ALLOC_STRICT 0x00001000 /* LV */
#define ALLOC_CONTIGUOUS 0x00002000 /* LV */
#define SNAPSHOT 0x00004000 /* LV */
#define SNAPSHOT_ORG 0x00008000 /* LV */
#define ALLOC_SIMPLE 0x00001000 /* LVM */
#define ALLOC_STRICT 0x00002000 /* LV */
#define ALLOC_CONTIGUOUS 0x00004000 /* LV */
#define SNAPSHOT 0x00008000 /* LV */
#define SNAPSHOT_ORG 0x00010000 /* LV */
#define EXPORTED_TAG "PV_EXP" /* Identifier of exported PV */