]> sourceware.org Git - lvm2.git/commitdiff
o Stuff
authorJoe Thornber <thornber@redhat.com>
Mon, 12 Nov 2001 19:28:50 +0000 (19:28 +0000)
committerJoe Thornber <thornber@redhat.com>
Mon, 12 Nov 2001 19:28:50 +0000 (19:28 +0000)
lib/metadata/lv_manip.c
lib/metadata/metadata.c
lib/metadata/metadata.h
tools/lvcreate.c

index 570c2d1f5b1881bad77d1d0fa0c3c7b17a0393a1..bf3edd93979ecfd626c39033084d6958c101f2b2 100644 (file)
@@ -322,3 +322,21 @@ int lv_extend(struct logical_volume *lv, uint32_t extents,
        pool_free(cmd->mem, new_map);
        return 0;
 }
+
+/* FIXME: I don't like the way the lvh is passed in here - EJT */
+int lv_remove(struct volume_group *vg, struct list *lvh)
+{
+       int i;
+       struct logical_volume *lv;
+
+       lv = &list_item(lvh, struct lv_list)->lv;
+       for (i = 0; i < lv->le_count; i++)
+               lv->map[i].pv->pe_allocated--;
+
+       vg->lv_count--;
+       vg->free_count += lv->le_count;
+
+       list_del(lvh);
+
+       return 1;
+}
index 4ad5ab2ed2022ec036e3628c886988deca6d890d..24be027f53292f7aa2d33849ff55f3b632785c8e 100644 (file)
@@ -288,19 +288,3 @@ struct physical_volume *_find_pv(struct volume_group *vg, struct device *dev)
        }
        return NULL;
 }
-
-int lv_remove(struct volume_group *vg, struct list *lvh)
-{
-       int i;
-       struct logical_volume *lv;
-
-       lv = &list_item(lvh, struct lv_list)->lv;
-       for (i = 0; i < lv->le_count; i++) {
-               lv->map[i].pv->pe_allocated--;
-       }
-
-       list_del(lvh);
-       vg->lv_count--;
-
-       return 1;
-}
index a708421d0ef11661e2364359906a27a74a5cbe0c..cee8217930a468ba8e9e85a3e599c2e74ea37af3 100644 (file)
 #define CLUSTERED              0x00000400  /* VG */
 #define SHARED                 0x00000800  /* VG */
 
-#define ALLOC_SIMPLE            0x00001000  /* LVM */
+/* FIXME: This should be an enum rather than a bitset,
+   remove from status - EJT */
+#define ALLOC_SIMPLE            0x00001000  /* LV */
 #define ALLOC_STRICT           0x00002000  /* LV */
 #define ALLOC_CONTIGUOUS       0x00004000  /* LV */
-#define SNAPSHOT               0x00008000  /* LV */
-#define SNAPSHOT_ORG           0x00010000  /* LV */
+
+#define SNAPSHOT               0x00010000  /* LV */
+#define SNAPSHOT_ORG           0x00020000  /* LV */
 
 
 #define EXPORTED_TAG "PV_EXP"  /* Identifier of exported PV */
@@ -244,6 +247,8 @@ int lv_reduce(struct logical_volume *lv, uint32_t extents);
 int lv_extend(struct logical_volume *lv,
              uint32_t extents, struct list *allocatable_pvs);
 
+int lv_remove(struct volume_group *vg, struct list *lvh);
+
 
 /* FIXME: Move to other files */
 int id_eq(struct id *op1, struct id *op2);
@@ -254,8 +259,6 @@ int pv_remove(struct volume_group *vg, struct physical_volume *pv);
 struct physical_volume *pv_find(struct volume_group *vg,
                                const char *pv_name);
 
-/* Remove an LV from a given VG */
-int lv_remove(struct volume_group *vg, struct list *lvh);
 
 /* Find a PV within a given VG */
 struct list *find_pv_in_vg(struct volume_group *vg, const char *pv_name);
index 641144d7121cf28d6fae0e7be14a5aa528ab30ea..04d77c2431fc2899ae3cbda6fe21b37502883f8c 100644 (file)
@@ -44,6 +44,8 @@ int lvcreate(int argc, char **argv)
 
        if (strcmp(arg_str_value(contiguous_ARG, "n"), "n"))
                status |= ALLOC_CONTIGUOUS;
+       else
+               status |= ALLOC_SIMPLE;
 
        zero = strcmp(arg_str_value(zero_ARG, "y"), "n");
 
@@ -84,7 +86,7 @@ int lvcreate(int argc, char **argv)
                          "using -n");
                return EINVALID_CMD_LINE;
        }
-               
+
        /* If VG not on command line, try -n arg and then environment */
        if (!argc) {
                if (!(vg_name = extract_vgname(fid, lv_name))) {
@@ -225,7 +227,7 @@ int lvcreate(int argc, char **argv)
 
        log_verbose("Creating logical volume %s", lv_name);
 
-       if (!(lv = lv_create(lv_name, status, stripes, stripesize, 
+       if (!(lv = lv_create(lv_name, status, stripes, stripesize,
                             extents, vg, pvh)))
                return ECMD_FAILED;
 
This page took 0.041374 seconds and 5 git commands to generate.