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;
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)
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;
}
#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 */