]> sourceware.org Git - lvm2.git/commitdiff
o Add ALLOC_SIMPLE
authorJoe Thornber <thornber@redhat.com>
Mon, 12 Nov 2001 17:55:05 +0000 (17:55 +0000)
committerJoe Thornber <thornber@redhat.com>
Mon, 12 Nov 2001 17:55:05 +0000 (17:55 +0000)
lib/format1/import-export.c
lib/metadata/lv_manip.c
lib/metadata/metadata.h

index cb896400821ed6acd2733fc15fb21174aea8cd6c..84dca77da3187b8ffed10110faf8c337867507a9 100644 (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)
index c410506b18a75cd89207e0b287d403d394a5fa3c..570c2d1f5b1881bad77d1d0fa0c3c7b17a0393a1 100644 (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;
        }
index 9dfe555743eb3e7cd066cce145436e5b3846f20d..a708421d0ef11661e2364359906a27a74a5cbe0c 100644 (file)
 #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 */
This page took 0.044844 seconds and 5 git commands to generate.