diff options
author | Dave Wysochanski <dwysocha@redhat.com> | 2007-10-12 14:29:32 +0000 |
---|---|---|
committer | Dave Wysochanski <dwysocha@redhat.com> | 2007-10-12 14:29:32 +0000 |
commit | 1b8de4cb25dcf69b7242cecfee90775bd7e1f15e (patch) | |
tree | 9fbc0406b7a3e4632e1113d30aaf5d2b60e001f1 /tools | |
parent | 70d9f98ed351fd98816acd7befa0fa7321168941 (diff) | |
download | lvm2-1b8de4cb25dcf69b7242cecfee90775bd7e1f15e.tar.gz lvm2-1b8de4cb25dcf69b7242cecfee90775bd7e1f15e.tar.xz lvm2-1b8de4cb25dcf69b7242cecfee90775bd7e1f15e.zip |
Add pv_dev_name() to access PV device name.
Patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/pvchange.c | 2 | ||||
-rw-r--r-- | tools/pvdisplay.c | 2 | ||||
-rw-r--r-- | tools/pvscan.c | 8 | ||||
-rw-r--r-- | tools/toollib.c | 4 | ||||
-rw-r--r-- | tools/vgconvert.c | 12 | ||||
-rw-r--r-- | tools/vgmerge.c | 4 | ||||
-rw-r--r-- | tools/vgreduce.c | 4 | ||||
-rw-r--r-- | tools/vgsplit.c | 2 |
8 files changed, 19 insertions, 19 deletions
diff --git a/tools/pvchange.c b/tools/pvchange.c index 3dfaf5fb..007f6a7d 100644 --- a/tools/pvchange.c +++ b/tools/pvchange.c @@ -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))); diff --git a/tools/pvdisplay.c b/tools/pvdisplay.c index 0138ee19..40ffe36c 100644 --- a/tools/pvdisplay.c +++ b/tools/pvdisplay.c @@ -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)) { diff --git a/tools/pvscan.c b/tools/pvscan.c index 8299cc98..1463daa0 100644 --- a/tools/pvscan.c +++ b/tools/pvscan.c @@ -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)); diff --git a/tools/toollib.c b/tools/toollib.c index 6a9e911e..b7423852 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -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; diff --git a/tools/vgconvert.c b/tools/vgconvert.c index 07977e34..a5bba04a 100644 --- a/tools/vgconvert.c +++ b/tools/vgconvert.c @@ -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)); } diff --git a/tools/vgmerge.c b/tools/vgmerge.c index 3bcf1f40..6cbbb3c1 100644 --- a/tools/vgmerge.c +++ b/tools/vgmerge.c @@ -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; } } diff --git a/tools/vgreduce.c b/tools/vgreduce.c index 8b079f83..4bf60c43 100644 --- a/tools/vgreduce.c +++ b/tools/vgreduce.c @@ -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; } diff --git a/tools/vgsplit.c b/tools/vgsplit.c index eebf91b5..5422e340 100644 --- a/tools/vgsplit.c +++ b/tools/vgsplit.c @@ -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; } |