]> sourceware.org Git - lvm2.git/commitdiff
Add pv_dev_name() to access PV device name.
authorDave Wysochanski <dwysocha@redhat.com>
Fri, 12 Oct 2007 14:29:32 +0000 (14:29 +0000)
committerDave Wysochanski <dwysocha@redhat.com>
Fri, 12 Oct 2007 14:29:32 +0000 (14:29 +0000)
Patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>

22 files changed:
WHATS_NEW
lib/display/display.c
lib/format1/import-export.c
lib/format1/layout.c
lib/format_text/archiver.c
lib/format_text/export.c
lib/format_text/format-text.c
lib/format_text/import_vsn1.c
lib/metadata/lv_manip.c
lib/metadata/metadata-exported.h
lib/metadata/metadata.c
lib/metadata/mirror.c
lib/metadata/pv_manip.c
lib/metadata/pv_map.c
tools/pvchange.c
tools/pvdisplay.c
tools/pvscan.c
tools/toollib.c
tools/vgconvert.c
tools/vgmerge.c
tools/vgreduce.c
tools/vgsplit.c

index 7957af6cfddec1c60a1bfbef477affc3e228f02e..58ea3925b97f6444758a4b8442f347f3d0cdd5ce 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.29 -
 ==================================
+  Add pv_dev_name() to access PV device name.
   Add const attributes to pv accessor functions.
   Refactor vg_add_snapshot and lv_create_empty.
   Handle new sysfs subsystem/block/devices directory structure.
index 3b7003f6b86f1fbbf2a5b1d6350f7073c733d597..d71f97802d50ce049918eb87e52bd69317000ab8 100644 (file)
@@ -246,7 +246,7 @@ void pvdisplay_colons(const struct physical_volume *pv)
        }
 
        log_print("%s:%s:%" PRIu64 ":-1:%u:%u:-1:%" PRIu32 ":%u:%u:%u:%s",
-                 dev_name(pv->dev), pv->vg_name, pv->size,
+                 pv_dev_name(pv), pv->vg_name, pv->size,
                  /* FIXME pv->pv_number, Derive or remove? */
                  pv->status,   /* FIXME Support old or new format here? */
                  pv->status & ALLOCATABLE_PV,  /* FIXME remove? */
@@ -305,7 +305,7 @@ void pvdisplay_full(const struct cmd_context *cmd,
        }
 
        log_print("--- %sPhysical volume ---", pv->pe_size ? "" : "NEW ");
-       log_print("PV Name               %s", dev_name(pv->dev));
+       log_print("PV Name               %s", pv_dev_name(pv));
        log_print("VG Name               %s%s", pv->vg_name,
                  pv->status & EXPORTED_VG ? " (exported)" : "");
 
@@ -363,7 +363,7 @@ int pvdisplay_short(const struct cmd_context *cmd __attribute((unused)),
                return 0;
        }
 
-       log_print("PV Name               %s     ", dev_name(pv->dev));
+       log_print("PV Name               %s     ", pv_dev_name(pv));
        /* FIXME  pv->pv_number); */
        log_print("PV UUID               %s", *uuid ? uuid : "none");
        log_print("PV Status             %sallocatable",
@@ -515,7 +515,7 @@ void display_stripe(const struct lv_segment *seg, uint32_t s, const char *pre)
                /* FIXME Re-check the conditions for 'Missing' */
                log_print("%sPhysical volume\t%s", pre,
                          seg_pv(seg, s) ?
-                         dev_name(seg_dev(seg, s)) :
+                         pv_dev_name(seg_pv(seg, s)) :
                            "Missing");
 
                if (seg_pv(seg, s))
index 791a5cd3fef334f14825bd723c96ff0b315d6b9a..7c61d7c5261030c8f00b8cbfa50fa57d3aee9e9b 100644 (file)
@@ -74,7 +74,7 @@ int import_pv(const struct format_type *fmt, struct dm_pool *mem,
            strncmp(vg->system_id, (char *)pvd->system_id, sizeof(pvd->system_id)))
                    log_very_verbose("System ID %s on %s differs from %s for "
                                     "volume group", pvd->system_id,
-                                    dev_name(pv->dev), vg->system_id);
+                                    pv_dev_name(pv), vg->system_id);
 
        /*
         * If exported, we still need to flag in pv->status too because
@@ -95,19 +95,19 @@ int import_pv(const struct format_type *fmt, struct dm_pool *mem,
        /* Fix up pv size if missing */
        if (!pv->size) {
                if (!dev_get_size(dev, &pv->size)) {
-                       log_error("%s: Couldn't get size.", dev_name(pv->dev));
+                       log_error("%s: Couldn't get size.", pv_dev_name(pv));
                        return 0;
                }
                log_verbose("Fixing up missing format1 size (%s) "
                            "for PV %s", display_size(fmt->cmd, pv->size),
-                           dev_name(pv->dev));
+                           pv_dev_name(pv));
                if (vg) {
                        size = pv->pe_count * (uint64_t) vg->extent_size +
                               pv->pe_start;
                        if (size > pv->size)
                                log_error("WARNING: Physical Volume %s is too "
                                          "large for underlying device",
-                                         dev_name(pv->dev));
+                                         pv_dev_name(pv));
                }
        }
 
index 648ce551eed395767c2d9c5c99ca947b42e4b495..93cbade6d2dd379c62664a052d9bf976b0a9c16f 100644 (file)
@@ -139,7 +139,7 @@ int calculate_extent_count(struct physical_volume *pv, uint32_t extent_size,
 
        if (pvd->pe_total < PE_SIZE_PV_SIZE_REL) {
                log_error("Too few extents on %s.  Try smaller extent size.",
-                         dev_name(pv->dev));
+                         pv_dev_name(pv));
                dm_free(pvd);
                return 0;
        }
@@ -160,7 +160,7 @@ int calculate_extent_count(struct physical_volume *pv, uint32_t extent_size,
 
        if (pvd->pe_total > MAX_PE_TOTAL) {
                log_error("Metadata extent limit (%u) exceeded for %s - "
-                         "%u required", MAX_PE_TOTAL, dev_name(pv->dev),
+                         "%u required", MAX_PE_TOTAL, pv_dev_name(pv),
                          pvd->pe_total);
                dm_free(pvd);
                return 0;
index 1dae50ab65a8cfb99f1293a877d05701ab2ffe02..9aa803b04d179c2b6065f7e2f31aadff26bc2ca5 100644 (file)
@@ -307,19 +307,19 @@ int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg)
                pv = pvl->pv;
                if (!(info = info_from_pvid(pv->dev->pvid))) {
                        log_error("PV %s missing from cache",
-                                 dev_name(pv->dev));
+                                 pv_dev_name(pv));
                        return 0;
                }
                if (cmd->fmt != info->fmt) {
                        log_error("PV %s is a different format (seqno %s)",
-                                 dev_name(pv->dev), info->fmt->name);
+                                 pv_dev_name(pv), info->fmt->name);
                        return 0;
                }
                if (!vg->fid->fmt->ops->
                    pv_setup(vg->fid->fmt, UINT64_C(0), 0, 0, 0,
                             UINT64_C(0), &vg->fid->metadata_areas, pv, vg)) {
                        log_error("Format-specific setup for %s failed",
-                                 dev_name(pv->dev));
+                                 pv_dev_name(pv));
                        return 0;
                }
        }
index 61baf2fbd592e4aff0f09e82c8699861fda1d032..7a312929cee996fcbe068e27047400eb6c179776 100644 (file)
@@ -360,7 +360,7 @@ static int _print_vg(struct formatter *f, struct volume_group *vg)
 static const char *_get_pv_name(struct formatter *f, struct physical_volume *pv)
 {
        return (pv) ? (const char *)
-           dm_hash_lookup(f->pv_names, dev_name(pv->dev)) : "Missing";
+           dm_hash_lookup(f->pv_names, pv_dev_name(pv)) : "Missing";
 }
 
 static int _print_pvs(struct formatter *f, struct volume_group *vg)
@@ -391,7 +391,7 @@ static int _print_pvs(struct formatter *f, struct volume_group *vg)
                }
 
                outf(f, "id = \"%s\"", buffer);
-               if (!out_hint(f, "device = \"%s\"", dev_name(pv->dev))) {
+               if (!out_hint(f, "device = \"%s\"", pv_dev_name(pv))) {
                        stack;
                        return 0;
                }
@@ -636,7 +636,7 @@ static int _build_pv_names(struct formatter *f, struct volume_group *vg)
                if (!(name = dm_pool_strdup(f->mem, buffer)))
                        return_0;
 
-               if (!dm_hash_insert(f->pv_names, dev_name(pv->dev), name))
+               if (!dm_hash_insert(f->pv_names, pv_dev_name(pv), name))
                        return_0;
        }
 
index 1653855cc3de1dcc9099a530da6a873ae52479ad..f6511348bc9b42e9c90a47980694a9cf3aa300c9 100644 (file)
@@ -1183,7 +1183,7 @@ static int _mda_setup(const struct format_type *fmt,
 
        if (pe_end > disk_size) {
                log_error("Physical extents end beyond end of device %s!",
-                         dev_name(pv->dev));
+                         pv_dev_name(pv));
                return 0;
        }
 
@@ -1204,7 +1204,7 @@ static int _mda_setup(const struct format_type *fmt,
        /* Ensure it's not going to be bigger than the disk! */
        if (start1 + mda_size1 > disk_size) {
                log_warn("WARNING: metadata area fills disk leaving no "
-                        "space for data on %s.", dev_name(pv->dev));
+                        "space for data on %s.", pv_dev_name(pv));
                /* Leave some free space for rounding */
                /* Avoid empty data area as could cause tools problems */
                mda_size1 = disk_size - start1 - alignment * 2;
@@ -1647,7 +1647,7 @@ static int _text_pv_setup(const struct format_type *fmt,
                                   vg->extent_size;
                        if (pe_count > UINT32_MAX) {
                                log_error("PV %s too large for extent size %s.",
-                                         dev_name(pv->dev),
+                                         pv_dev_name(pv),
                                          display_size(vg->cmd, (uint64_t) vg->extent_size));
                                return 0;
                        }
index ea207fad112118101323f2da0c44576ddf614150..ef7ae8dfa30fda882515e584b2249dc2c360c689 100644 (file)
@@ -202,7 +202,7 @@ static int _read_pv(struct format_instance *fid, struct dm_pool *mem,
        if ((cn = find_config_node(pvn, "tags")) &&
            !(read_tags(mem, &pv->tags, cn->v))) {
                log_error("Couldn't read tags for physical volume %s in %s.",
-                         dev_name(pv->dev), vg->name);
+                         pv_dev_name(pv), vg->name);
                return 0;
        }
 
@@ -218,19 +218,19 @@ static int _read_pv(struct format_instance *fid, struct dm_pool *mem,
         /* Fix up pv size if missing */
         if (!pv->size && pv->dev) {
                 if (!dev_get_size(pv->dev, &pv->size)) {
-                        log_error("%s: Couldn't get size.", dev_name(pv->dev));
+                        log_error("%s: Couldn't get size.", pv_dev_name(pv));
                         return 0;
                 }
                 log_verbose("Fixing up missing format1 size (%s) "
                             "for PV %s", display_size(fid->fmt->cmd, pv->size),
-                            dev_name(pv->dev));
+                            pv_dev_name(pv));
                 if (vg) {
                         size = pv->pe_count * (uint64_t) vg->extent_size +
                                pv->pe_start;
                         if (size > pv->size)
                                 log_error("WARNING: Physical Volume %s is too "
                                           "large for underlying device",
-                                          dev_name(pv->dev));
+                                          pv_dev_name(pv));
                 }
         }
 
index 59fe2a2eb366971bc180314de4e715a2acdbda3e..0e97580ca5ca6c55112b11a17920a5678a342262 100644 (file)
@@ -526,7 +526,7 @@ static int _log_parallel_areas(struct dm_pool *mem, struct list *parallel_areas)
 
        list_iterate_items(spvs, parallel_areas) {
                list_iterate_items(pvl, &spvs->pvs) {
-                       if (!dm_pool_grow_object(mem, dev_name(pvl->pv->dev), strlen(dev_name(pvl->pv->dev)))) {
+                       if (!dm_pool_grow_object(mem, pv_dev_name(pvl->pv), strlen(pv_dev_name(pvl->pv)))) {
                                log_error("dm_pool_grow_object failed");
                                dm_pool_abandon_object(mem);
                                return 0;
index 0e1f18d6f9341889267aabb03a5abb56bcb9e46b..8893d35101b869eeac9d848016b884ffb6ddcf60 100644 (file)
@@ -470,6 +470,7 @@ char *generate_lv_name(struct volume_group *vg, const char *format,
 */
 struct device *pv_dev(const pv_t *pv);
 const char *pv_vg_name(const pv_t *pv);
+const char *pv_dev_name(const pv_t *pv);
 uint64_t pv_size(const pv_t *pv);
 uint32_t pv_status(const pv_t *pv);
 uint32_t pv_pe_size(const pv_t *pv);
index ef41d6835a8bc7305d875fbf9f7267541a5b3f35..66d3b6986d14fa1a301d6a92060b317d0d0e7f4a 100644 (file)
@@ -241,7 +241,7 @@ int vg_rename(struct cmd_context *cmd, struct volume_group *vg,
        list_iterate_items(pvl, &vg->pvs) {
                if (!(pvl->pv->vg_name = dm_pool_strdup(mem, new_name))) {
                        log_error("pv->vg_name allocation failed for '%s'",
-                                 dev_name(pvl->pv->dev));
+                                 pv_dev_name(pvl->pv));
                        return 0;
                }
        }
@@ -313,12 +313,12 @@ int vg_remove_single(struct cmd_context *cmd, const char *vg_name,
        list_iterate_items(pvl, &vg->pvs) {
                pv = pvl->pv;
                log_verbose("Removing physical volume \"%s\" from "
-                           "volume group \"%s\"", dev_name(pv_dev(pv)), vg_name);
+                           "volume group \"%s\"", pv_dev_name(pv), vg_name);
                pv->vg_name = ORPHAN;
                pv->status = ALLOCATABLE_PV;
 
                if (!dev_get_size(pv_dev(pv), &pv->size)) {
-                       log_error("%s: Couldn't get size.", dev_name(pv_dev(pv)));
+                       log_error("%s: Couldn't get size.", pv_dev_name(pv));
                        ret = 0;
                        continue;
                }
@@ -327,7 +327,7 @@ int vg_remove_single(struct cmd_context *cmd, const char *vg_name,
                if (!pv_write(cmd, pv, NULL, INT64_C(-1))) {
                        log_error("Failed to remove physical volume \"%s\""
                                  " from volume group \"%s\"",
-                                 dev_name(pv_dev(pv)), vg_name);
+                                 pv_dev_name(pv), vg_name);
                        ret = 0;
                }
        }
@@ -530,13 +530,13 @@ int vg_change_pesize(struct cmd_context *cmd __attribute((unused)),
                pv = pvl->pv;
 
                pv->pe_size = new_size;
-               if (!_recalc_extents(&pv->pe_count, dev_name(pv->dev), "",
+               if (!_recalc_extents(&pv->pe_count, pv_dev_name(pv), "",
                                     old_size, new_size)) {
                        stack;
                        return 0;
                }
 
-               if (!_recalc_extents(&pv->pe_alloc_count, dev_name(pv->dev),
+               if (!_recalc_extents(&pv->pe_alloc_count, pv_dev_name(pv),
                                     " allocated space", old_size, new_size)) {
                        stack;
                        return 0;
@@ -547,13 +547,13 @@ int vg_change_pesize(struct cmd_context *cmd __attribute((unused)),
                        if (pvseg->lvseg)
                                continue;
 
-                       if (!_recalc_extents(&pvseg->pe, dev_name(pv->dev),
+                       if (!_recalc_extents(&pvseg->pe, pv_dev_name(pv),
                                             " PV segment start", old_size,
                                             new_size)) {
                                stack;
                                return 0;
                        }
-                       if (!_recalc_extents(&pvseg->len, dev_name(pv->dev),
+                       if (!_recalc_extents(&pvseg->len, pv_dev_name(pv),
                                             " PV segment length", old_size,
                                             new_size)) {
                                stack;
@@ -742,22 +742,22 @@ static struct physical_volume *_pv_create(const struct format_type *fmt,
        pv->status = ALLOCATABLE_PV;
 
        if (!dev_get_size(pv->dev, &pv->size)) {
-               log_error("%s: Couldn't get size.", dev_name(pv->dev));
+               log_error("%s: Couldn't get size.", pv_dev_name(pv));
                goto bad;
        }
 
        if (size) {
                if (size > pv->size)
                        log_warn("WARNING: %s: Overriding real size. "
-                                 "You could lose data.", dev_name(pv->dev));
+                                 "You could lose data.", pv_dev_name(pv));
                log_verbose("%s: Pretending size is %" PRIu64 " sectors.",
-                           dev_name(pv->dev), size);
+                           pv_dev_name(pv), size);
                pv->size = size;
        }
 
        if (pv->size < PV_MIN_SIZE) {
                log_error("%s: Size must exceed minimum of %ld sectors.",
-                         dev_name(pv->dev), PV_MIN_SIZE);
+                         pv_dev_name(pv), PV_MIN_SIZE);
                goto bad;
        }
 
@@ -775,7 +775,7 @@ static struct physical_volume *_pv_create(const struct format_type *fmt,
                                pvmetadatacopies, pvmetadatasize, mdas,
                                pv, NULL)) {
                log_error("%s: Format-specific setup of physical volume "
-                         "failed.", dev_name(pv->dev));
+                         "failed.", pv_dev_name(pv));
                goto bad;
        }
        return pv;
@@ -988,7 +988,7 @@ int vg_validate(struct volume_group *vg)
                                         stack;
                                log_error("Internal error: Duplicate PV id "
                                          "%s detected for %s in %s.",
-                                         uuid, dev_name(pvl->pv->dev),
+                                         uuid, pv_dev_name(pvl->pv),
                                          vg->name);
                                r = 0;
                        }
@@ -996,7 +996,7 @@ int vg_validate(struct volume_group *vg)
 
                if (strcmp(pvl->pv->vg_name, vg->name)) {
                        log_error("Internal error: VG name for PV %s is corrupted",
-                                 dev_name(pvl->pv->dev));
+                                 pv_dev_name(pvl->pv));
                        r = 0;
                }
        }
@@ -1215,7 +1215,7 @@ static int _update_pv_list(struct list *all_pvs, struct volume_group *vg)
                /* PV is not on list so add it.  Note that we don't copy it. */
                        if (!(pvl2 = dm_pool_zalloc(vg->cmd->mem, sizeof(*pvl2)))) {
                        log_error("pv_list allocation for '%s' failed",
-                                 dev_name(pvl->pv->dev));
+                                 pv_dev_name(pvl->pv));
                        return 0;
                }
                pvl2->pv = pvl->pv;
@@ -1454,7 +1454,7 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
                        if (!id_write_format(&pvl->pv->id, uuid, sizeof(uuid)))
                                return_NULL;
                        log_error("Removing PV %s (%s) that no longer belongs to VG %s",
-                                 dev_name(pvl->pv->dev), uuid, correct_vg->name);
+                                 pv_dev_name(pvl->pv), uuid, correct_vg->name);
                        if (!pv_write_orphan(cmd, pvl->pv))
                                return_NULL;
       next_pv:
@@ -1781,14 +1781,14 @@ int pv_write_orphan(struct cmd_context *cmd, struct physical_volume *pv)
        pv->status = ALLOCATABLE_PV;
 
        if (!dev_get_size(pv->dev, &pv->size)) {
-               log_error("%s: Couldn't get size.", dev_name(pv->dev));
+               log_error("%s: Couldn't get size.", pv_dev_name(pv));
                return 0;
        }
 
        if (!_pv_write(cmd, pv, NULL, INT64_C(-1))) {
                log_error("Failed to clear metadata from physical "
                          "volume \"%s\" after removal from \"%s\"",
-                         dev_name(pv->dev), old_vg_name);
+                         pv_dev_name(pv), old_vg_name);
                return 0;
        }
 
@@ -1952,6 +1952,11 @@ const char *pv_vg_name(const pv_t *pv)
        return pv_field(pv, vg_name);
 }
 
+const char *pv_dev_name(const pv_t *pv)
+{
+       return dev_name(pv_dev(pv));
+}
+
 uint64_t pv_size(const pv_t *pv)
 {
        return pv_field(pv, size);
index 014eae104e6cd925205e58ba5edf2ba0cac3f927..1f96420bcaae6755c655258aaf70446c65925f49 100644 (file)
@@ -651,7 +651,7 @@ int insert_pvmove_mirrors(struct cmd_context *cmd,
                                pv = seg_pv(seg, s);
                                pe = seg_pe(seg, s);
                                log_very_verbose("Moving %s:%u-%u of %s/%s",
-                                                dev_name(pvl->pv->dev),
+                                                pv_dev_name(pvl->pv),
                                                 pe, pe + seg->area_len - 1,
                                                 lv->vg->name, lv->name);
 
index 9f483cd8e6b8138721d421aa4830e492b945067d..ce2d0361f93568579953d52ac8d0239823481708 100644 (file)
@@ -122,7 +122,7 @@ int pv_split_segment(struct physical_volume *pv, uint32_t pe)
 
        if (!(peg = find_peg_by_pe(pv, pe))) {
                log_error("Segment with extent %" PRIu32 " in PV %s not found",
-                         pe, dev_name(pv->dev));
+                         pe, pv_dev_name(pv));
                return 0;
        }
 
@@ -162,7 +162,7 @@ struct pv_segment *assign_peg_to_lvseg(struct physical_volume *pv,
 
        if (!(peg = find_peg_by_pe(pv, pe))) {
                log_error("Missing PV segment on %s at %u.",
-                         dev_name(pv->dev), pe);
+                         pv_dev_name(pv), pe);
                return NULL;
        }
 
@@ -179,7 +179,7 @@ int release_pv_segment(struct pv_segment *peg, uint32_t area_reduction)
 {
        if (!peg->lvseg) {
                log_error("release_pv_segment with unallocated segment: "
-                         "%s PE %" PRIu32, dev_name(peg->pv->dev), peg->pe);
+                         "%s PE %" PRIu32, pv_dev_name(peg->pv), peg->pe);
                return 0;
        }
 
@@ -279,7 +279,7 @@ int check_pv_segments(struct volume_group *vg)
 
                        /* FIXME Remove this next line eventually */
                        log_debug("%s %u: %6u %6u: %s(%u:%u)",
-                                 dev_name(pv->dev), segno++, peg->pe, peg->len,
+                                 pv_dev_name(pv), segno++, peg->pe, peg->len,
                                  peg->lvseg ? peg->lvseg->lv->name : "NULL",
                                  peg->lvseg ? peg->lvseg->le : 0, s);
                        /* FIXME Add details here on failure instead */
@@ -353,7 +353,7 @@ static int _reduce_pv(struct physical_volume *pv, struct volume_group *vg, uint3
        if (new_pe_count < pv->pe_alloc_count) {
                log_error("%s: cannot resize to %" PRIu32 " extents "
                          "as %" PRIu32 " are allocated.",
-                         dev_name(pv->dev), new_pe_count,
+                         pv_dev_name(pv), new_pe_count,
                          pv->pe_alloc_count);
                return 0;
        }
@@ -366,7 +366,7 @@ static int _reduce_pv(struct physical_volume *pv, struct volume_group *vg, uint3
                if (peg->lvseg) {
                        log_error("%s: cannot resize to %" PRIu32 " extents as "
                                  "later ones are allocated.",
-                                 dev_name(pv->dev), new_pe_count);
+                                 pv_dev_name(pv), new_pe_count);
                        return 0;
                }
        }
@@ -397,7 +397,7 @@ static int _extend_pv(struct physical_volume *pv, struct volume_group *vg,
 
        if ((uint64_t) new_pe_count * pv->pe_size > pv->size ) {
                log_error("%s: cannot resize to %" PRIu32 " extents as there "
-                         "is only room for %" PRIu64 ".", dev_name(pv->dev),
+                         "is only room for %" PRIu64 ".", pv_dev_name(pv),
                          new_pe_count, pv->size / pv->pe_size);
                return 0;
        }
@@ -426,13 +426,13 @@ int pv_resize(struct physical_volume *pv,
 {
        if ((new_pe_count == pv->pe_count)) {
                log_verbose("No change to size of physical volume %s.",
-                           dev_name(pv->dev));
+                           pv_dev_name(pv));
                return 1;
        }
 
        log_verbose("Resizing physical volume %s from %" PRIu32
                    " to %" PRIu32 " extents.",
-                   dev_name(pv->dev), pv->pe_count, new_pe_count);
+                   pv_dev_name(pv), pv->pe_count, new_pe_count);
 
        if (new_pe_count > pv->pe_count)
                return _extend_pv(pv, vg, new_pe_count);
@@ -450,7 +450,7 @@ int pv_resize_single(struct cmd_context *cmd,
        uint64_t size = 0;
        uint32_t new_pe_count = 0;
        struct list mdas;
-       const char *pv_name = dev_name(pv_dev(pv));
+       const char *pv_name = pv_dev_name(pv);
        const char *vg_name;
 
        list_init(&mdas);
index 58aa813debe5a533dd020b17aa7dfb3fbbaee474..9c227029e5910dc29addd8396fd9580b538abe23 100644 (file)
@@ -46,7 +46,7 @@ static int _create_single_area(struct dm_pool *mem, struct pv_map *pvm,
        }
 
        log_debug("Allowing allocation on %s start PE %" PRIu32 " length %"
-                 PRIu32, dev_name(pvm->pv->dev), start, length);
+                 PRIu32, pv_dev_name(pvm->pv), start, length);
        pva->map = pvm;
        pva->start = start;
        pva->count = length;
index 3dfaf5fb252fe9e95fd22480637b7b6debab4726..007f6a7d136cf6b0dc6ffbbe9af2f6b5a3fee9a0 100644 (file)
@@ -26,7 +26,7 @@ static int _pvchange_single(struct cmd_context *cmd, struct physical_volume *pv,
        uint64_t sector;
        uint32_t orig_pe_alloc_count;
 
-       const char *pv_name = dev_name(pv_dev(pv));
+       const char *pv_name = pv_dev_name(pv);
        const char *tag = NULL;
        const char *orig_vg_name;
        char uuid[64] __attribute((aligned(8)));
index 0138ee194a1f298bba98864754ab43819d22c0b0..40ffe36ce9198fe6fe44f78b27e5180cc3db958d 100644 (file)
@@ -24,7 +24,7 @@ static int _pvdisplay_single(struct cmd_context *cmd,
        int ret = ECMD_PROCESSED;
        uint64_t size;
 
-       const char *pv_name = dev_name(pv_dev(pv));
+       const char *pv_name = pv_dev_name(pv);
 
         if (pv_vg_name(pv)) {
                 if (!lock_vol(cmd, pv_vg_name(pv), LCK_VG_READ)) {
index 8299cc98f61b506e95c1d6f99ea98f953ef0ae9b..1463daa0693b4ce5d6cf0e63d7f4077aa3367724 100644 (file)
@@ -31,7 +31,7 @@ static void _pvscan_display_single(struct cmd_context *cmd,
 
        /* short listing? */
        if (arg_count(cmd, short_ARG) > 0) {
-               log_print("%s", dev_name(pv_dev(pv)));
+               log_print("%s", pv_dev_name(pv));
                return;
        }
 
@@ -57,9 +57,9 @@ static void _pvscan_display_single(struct cmd_context *cmd,
                }
 
                sprintf(pv_tmp_name, "%-*s with UUID %s",
-                       pv_max_name_len - 2, dev_name(pv_dev(pv)), uuid);
+                       pv_max_name_len - 2, pv_dev_name(pv), uuid);
        } else {
-               sprintf(pv_tmp_name, "%s", dev_name(pv_dev(pv)));
+               sprintf(pv_tmp_name, "%s", pv_dev_name(pv));
        }
 
        if (!*pv_vg_name(pv)) {
@@ -173,7 +173,7 @@ int pvscan(struct cmd_context *cmd, int argc __attribute((unused)),
        pv_max_name_len = vg_max_name_len = 0;
        list_iterate_items(pvl, pvslist) {
                pv = pvl->pv;
-               len = strlen(dev_name(pv_dev(pv)));
+               len = strlen(pv_dev_name(pv));
                if (pv_max_name_len < len)
                        pv_max_name_len = len;
                len = strlen(pv_vg_name(pv));
index 6a9e911e2326f1056b7ec496ad0f5cbf92348bbd..b74238526b1f7a346e86b2cb5d183e99f31c4ea9 100644 (file)
@@ -1000,7 +1000,7 @@ static int _create_pv_entry(struct dm_pool *mem, struct pv_list *pvl,
        struct pv_list *new_pvl = NULL, *pvl2;
        struct list *pe_ranges;
 
-       pvname = dev_name(pvl->pv->dev);
+       pvname = pv_dev_name(pvl->pv);
        if (allocatable_only && !(pvl->pv->status & ALLOCATABLE_PV)) {
                log_error("Physical volume %s not allocatable", pvname);
                return 1;
@@ -1036,7 +1036,7 @@ static int _create_pv_entry(struct dm_pool *mem, struct pv_list *pvl,
        }
 
        /* Determine selected physical extents */
-       if (!_parse_pes(mem, colon, new_pvl->pe_ranges, dev_name(pvl->pv->dev),
+       if (!_parse_pes(mem, colon, new_pvl->pe_ranges, pv_dev_name(pvl->pv),
                        pvl->pv->pe_count)) {
                stack;
                return 0;
index 07977e34984622f6abe7bf3b31e61affb1e418bd..a5bba04a5e406ecbbf94f63217966a20a200179b 100644 (file)
@@ -118,7 +118,7 @@ static int vgconvert_single(struct cmd_context *cmd, const char *vg_name,
                                     pv_pe_size(existing_pv), pvmetadatacopies,
                                     pvmetadatasize, &mdas))) {
                        log_error("Failed to setup physical volume \"%s\"",
-                                 dev_name(pv_dev(existing_pv)));
+                                 pv_dev_name(existing_pv));
                        if (change_made)
                                log_error("Use pvcreate and vgcfgrestore to "
                                          "repair from archived metadata.");
@@ -129,30 +129,30 @@ static int vgconvert_single(struct cmd_context *cmd, const char *vg_name,
                change_made = 1;
 
                log_verbose("Set up physical volume for \"%s\" with %" PRIu64
-                           " available sectors", dev_name(pv_dev(pv)), pv_size(pv));
+                           " available sectors", pv_dev_name(pv), pv_size(pv));
 
                /* Wipe existing label first */
                if (!label_remove(pv_dev(pv))) {
                        log_error("Failed to wipe existing label on %s",
-                                 dev_name(pv_dev(pv)));
+                                 pv_dev_name(pv));
                        log_error("Use pvcreate and vgcfgrestore to repair "
                                  "from archived metadata.");
                        return ECMD_FAILED;
                }
 
                log_very_verbose("Writing physical volume data to disk \"%s\"",
-                                dev_name(pv_dev(pv)));
+                                pv_dev_name(pv));
                if (!(pv_write(cmd, pv, &mdas,
                               arg_int64_value(cmd, labelsector_ARG,
                                               DEFAULT_LABELSECTOR)))) {
                        log_error("Failed to write physical volume \"%s\"",
-                                 dev_name(pv_dev(pv)));
+                                 pv_dev_name(pv));
                        log_error("Use pvcreate and vgcfgrestore to repair "
                                  "from archived metadata.");
                        return ECMD_FAILED;
                }
                log_verbose("Physical volume \"%s\" successfully created",
-                           dev_name(pv_dev(pv)));
+                           pv_dev_name(pv));
 
        }
 
index 3bcf1f40c045ea02f1c06af8962106ba049c43b9..6cbbb3c18f4e1debaa66627f71d41d946354f2e1 100644 (file)
@@ -95,7 +95,7 @@ static int _vgmerge_single(struct cmd_context *cmd, const char *vg_name_to,
                if (pv_uses_vg(pvl->pv, vg_from)) {
                        log_error("Physical volume %s might be constructed "
                                  "from same volume group %s.",
-                                 dev_name(pvl->pv->dev), vg_from->name);
+                                 pv_dev_name(pvl->pv), vg_from->name);
                        goto error;
                }
        }
@@ -104,7 +104,7 @@ static int _vgmerge_single(struct cmd_context *cmd, const char *vg_name_to,
                if (pv_uses_vg(pvl->pv, vg_to)) {
                        log_error("Physical volume %s might be constructed "
                                  "from same volume group %s.",
-                                 dev_name(pvl->pv->dev), vg_to->name);
+                                 pv_dev_name(pvl->pv), vg_to->name);
                        goto error;
                }
        }
index 8b079f83712526ede4e92d35187439927cf568e6..4bf60c4377fcff9dd9fbef890edc5583cac84980 100644 (file)
@@ -365,7 +365,7 @@ static int _vgreduce_single(struct cmd_context *cmd, struct volume_group *vg,
                            void *handle __attribute((unused)))
 {
        struct pv_list *pvl;
-       const char *name = dev_name(pv_dev(pv));
+       const char *name = pv_dev_name(pv);
 
        if (pv_pe_alloc_count(pv)) {
                log_error("Physical volume \"%s\" still in use", name);
@@ -392,7 +392,7 @@ static int _vgreduce_single(struct cmd_context *cmd, struct volume_group *vg,
        pv->status = ALLOCATABLE_PV;
 
        if (!dev_get_size(pv_dev(pv), &pv->size)) {
-               log_error("%s: Couldn't get size.", dev_name(pv_dev(pv)));
+               log_error("%s: Couldn't get size.", pv_dev_name(pv));
                return ECMD_FAILED;
        }
 
index eebf91b56e9a899250c24920d16bda0afab61dd9..5422e34040599e17c09a63ea85a30c36790dd92c 100644 (file)
@@ -105,7 +105,7 @@ static int _move_lvs(struct volume_group *vg_from, struct volume_group *vg_to)
                                        continue;
                                }
                                log_error("Physical Volume %s not found",
-                                         dev_name(pv_dev(pv)));
+                                         pv_dev_name(pv));
                                return 0;
                        }
 
This page took 0.082713 seconds and 5 git commands to generate.