mirror of
git://sourceware.org/git/lvm2.git
synced 2025-02-27 01:57:55 +03:00
Convert pv->vg_name to get_pv_vg_name
This commit is contained in:
parent
8da9ec3599
commit
46d45273a1
@ -55,12 +55,12 @@ static int _pvchange_single(struct cmd_context *cmd, struct physical_volume *pv,
|
||||
log_verbose("Finding volume group of physical volume \"%s\"",
|
||||
pv_name);
|
||||
|
||||
if (!lock_vol(cmd, pv->vg_name, LCK_VG_WRITE)) {
|
||||
if (!lock_vol(cmd, get_pv_vg_name(pv), LCK_VG_WRITE)) {
|
||||
log_error("Can't get lock for %s", get_pv_vg_name(pv));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(vg = vg_read(cmd, pv->vg_name, NULL, &consistent))) {
|
||||
if (!(vg = vg_read(cmd, get_pv_vg_name(pv), NULL, &consistent))) {
|
||||
unlock_vg(cmd, get_pv_vg_name(pv));
|
||||
log_error("Unable to find volume group of \"%s\"",
|
||||
pv_name);
|
||||
@ -115,7 +115,7 @@ static int _pvchange_single(struct cmd_context *cmd, struct physical_volume *pv,
|
||||
}
|
||||
|
||||
if (arg_count(cmd, allocatable_ARG)) {
|
||||
if (!*pv->vg_name &&
|
||||
if (!*get_pv_vg_name(pv) &&
|
||||
!(pv->fmt->features & FMT_ORPHAN_ALLOCATABLE)) {
|
||||
log_error("Allocatability not supported by orphan "
|
||||
"%s format PV %s", pv->fmt->name, pv_name);
|
||||
@ -181,7 +181,7 @@ static int _pvchange_single(struct cmd_context *cmd, struct physical_volume *pv,
|
||||
}
|
||||
log_verbose("Changing uuid of %s to %s.", pv_name, uuid);
|
||||
if (*get_pv_vg_name(pv)) {
|
||||
orig_vg_name = pv->vg_name;
|
||||
orig_vg_name = get_pv_vg_name(pv);
|
||||
orig_pe_alloc_count = get_pv_pe_alloc_count(pv);
|
||||
pv->vg_name = ORPHAN;
|
||||
pv->pe_alloc_count = 0;
|
||||
|
@ -27,12 +27,12 @@ static int _pvdisplay_single(struct cmd_context *cmd,
|
||||
const char *pv_name = dev_name(get_pv_dev(pv));
|
||||
|
||||
if (get_pv_vg_name(pv)) {
|
||||
if (!lock_vol(cmd, pv->vg_name, LCK_VG_READ)) {
|
||||
if (!lock_vol(cmd, get_pv_vg_name(pv), LCK_VG_READ)) {
|
||||
log_error("Can't lock %s: skipping", get_pv_vg_name(pv));
|
||||
return ECMD_FAILED;
|
||||
}
|
||||
|
||||
if (!(vg = vg_read(cmd, pv->vg_name, (char *)&pv->vgid, &consistent))) {
|
||||
if (!(vg = vg_read(cmd, get_pv_vg_name(pv), (char *)&pv->vgid, &consistent))) {
|
||||
log_error("Can't read %s: skipping", get_pv_vg_name(pv));
|
||||
goto out;
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ static int _set_up_pvmove(struct cmd_context *cmd, const char *pv_name,
|
||||
}
|
||||
|
||||
if (arg_count(cmd, name_ARG)) {
|
||||
if (!(lv_name = _extract_lvname(cmd, pv->vg_name,
|
||||
if (!(lv_name = _extract_lvname(cmd, get_pv_vg_name(pv),
|
||||
arg_value(cmd, name_ARG)))) {
|
||||
stack;
|
||||
return EINVALID_CMD_LINE;
|
||||
|
@ -65,7 +65,7 @@ static int pvremove_check(struct cmd_context *cmd, const char *name)
|
||||
log_print("WARNING: Wiping physical volume label from "
|
||||
"%s%s%s%s", name,
|
||||
pv->vg_name[0] ? " of volume group \"" : "",
|
||||
pv->vg_name[0] ? pv->vg_name : "",
|
||||
pv->vg_name[0] ? get_pv_vg_name(pv) : "",
|
||||
pv->vg_name[0] ? "\"" : "");
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ static int _pvresize_single(struct cmd_context *cmd,
|
||||
return ECMD_FAILED;
|
||||
}
|
||||
} else {
|
||||
vg_name = pv->vg_name;
|
||||
vg_name = get_pv_vg_name(pv);
|
||||
|
||||
if (!lock_vol(cmd, vg_name, LCK_VG_WRITE)) {
|
||||
log_error("Can't get lock for %s", get_pv_vg_name(pv));
|
||||
|
@ -72,7 +72,7 @@ static void _pvscan_display_single(struct cmd_context *cmd,
|
||||
}
|
||||
|
||||
if (get_pv_status(pv) & EXPORTED_VG) {
|
||||
strncpy(vg_name_this, pv->vg_name, vg_name_len);
|
||||
strncpy(vg_name_this, get_pv_vg_name(pv), vg_name_len);
|
||||
log_print("PV %-*s is in exported VG %s "
|
||||
"[%s / %s free]",
|
||||
pv_max_name_len, pv_tmp_name,
|
||||
|
@ -61,12 +61,12 @@ static int _pvsegs_sub_single(struct cmd_context *cmd, struct volume_group *vg,
|
||||
struct physical_volume *pv = pvseg->pv;
|
||||
int ret = ECMD_PROCESSED;
|
||||
|
||||
if (!lock_vol(cmd, pv->vg_name, LCK_VG_READ)) {
|
||||
if (!lock_vol(cmd, get_pv_vg_name(pv), LCK_VG_READ)) {
|
||||
log_error("Can't lock %s: skipping", get_pv_vg_name(pv));
|
||||
return ECMD_FAILED;
|
||||
}
|
||||
|
||||
if (!(vg = vg_read(cmd, pv->vg_name, NULL, &consistent))) {
|
||||
if (!(vg = vg_read(cmd, get_pv_vg_name(pv), NULL, &consistent))) {
|
||||
log_error("Can't read %s: skipping", get_pv_vg_name(pv));
|
||||
goto out;
|
||||
}
|
||||
@ -107,12 +107,12 @@ static int _pvs_single(struct cmd_context *cmd, struct volume_group *vg,
|
||||
int ret = ECMD_PROCESSED;
|
||||
|
||||
if (get_pv_vg_name(pv)) {
|
||||
if (!lock_vol(cmd, pv->vg_name, LCK_VG_READ)) {
|
||||
if (!lock_vol(cmd, get_pv_vg_name(pv), LCK_VG_READ)) {
|
||||
log_error("Can't lock %s: skipping", get_pv_vg_name(pv));
|
||||
return ECMD_FAILED;
|
||||
}
|
||||
|
||||
if (!(vg = vg_read(cmd, pv->vg_name, (char *)&pv->vgid, &consistent))) {
|
||||
if (!(vg = vg_read(cmd, get_pv_vg_name(pv), (char *)&pv->vgid, &consistent))) {
|
||||
log_error("Can't read %s: skipping", get_pv_vg_name(pv));
|
||||
goto out;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user