]> sourceware.org Git - lvm2.git/commitdiff
Refactor format1 vg->pvs list add and vg->pv_count.
authorDave Wysochanski <dwysocha@redhat.com>
Tue, 6 Apr 2010 14:04:20 +0000 (14:04 +0000)
committerDave Wysochanski <dwysocha@redhat.com>
Tue, 6 Apr 2010 14:04:20 +0000 (14:04 +0000)
Refactor adding to the vg->pvs list and incrementing the count, which
will allow further refactoring.  Should be no functional change.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
lib/format1/disk-rep.h
lib/format1/format1.c
lib/format1/import-export.c

index 138794e3fa95673cbcfa6e7c5fe1f503fdab6046..b91be39d3ebbb115e389792e6391a777f351e388 100644 (file)
@@ -224,8 +224,7 @@ int export_extents(struct disk_list *dl, uint32_t lv_num,
                   struct logical_volume *lv, struct physical_volume *pv);
 
 int import_pvs(const struct format_type *fmt, struct dm_pool *mem,
-              struct volume_group *vg,
-              struct dm_list *pvds, struct dm_list *results, uint32_t *count);
+              struct volume_group *vg, struct dm_list *pvds);
 
 int import_lvs(struct dm_pool *mem, struct volume_group *vg, struct dm_list *pvds);
 int export_lvs(struct disk_list *dl, struct volume_group *vg,
index b6a2c15f7c72a5bcb13d2dde985a3c294c51d614..1167e04523596fb3c1cf2bc45e7d4e73e91b4d09 100644 (file)
@@ -142,7 +142,7 @@ static struct volume_group *_build_vg(struct format_instance *fid,
        if (!import_vg(mem, vg, dl))
                goto_bad;
 
-       if (!import_pvs(fid->fmt, mem, vg, pvs, &vg->pvs, &vg->pv_count))
+       if (!import_pvs(fid->fmt, mem, vg, pvs))
                goto_bad;
 
        if (!import_lvs(mem, vg, pvs))
index cd7cc7f8a3d75836d32a884bff89dfce1a943532..2ffc19e2146452c52cfb1721f511fa1f64aa57c6 100644 (file)
@@ -422,13 +422,12 @@ int export_extents(struct disk_list *dl, uint32_t lv_num,
 }
 
 int import_pvs(const struct format_type *fmt, struct dm_pool *mem,
-              struct volume_group *vg,
-              struct dm_list *pvds, struct dm_list *results, uint32_t *count)
+              struct volume_group *vg, struct dm_list *pvds)
 {
        struct disk_list *dl;
        struct pv_list *pvl;
 
-       *count = 0;
+       vg->pv_count = 0;
        dm_list_iterate_items(dl, pvds) {
                if (!(pvl = dm_pool_zalloc(mem, sizeof(*pvl))) ||
                    !(pvl->pv = dm_pool_alloc(mem, sizeof(*pvl->pv))))
@@ -438,8 +437,8 @@ int import_pvs(const struct format_type *fmt, struct dm_pool *mem,
                        return_0;
 
                pvl->pv->fmt = fmt;
-               dm_list_add(results, &pvl->list);
-               (*count)++;
+               dm_list_add(&vg->pvs, &pvl->list);
+               vg->pv_count++;
        }
 
        return 1;
This page took 0.036936 seconds and 5 git commands to generate.