diff options
author | Alasdair Kergon <agk@redhat.com> | 2007-11-15 02:20:03 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2007-11-15 02:20:03 +0000 |
commit | e5f7352bef5c2fcf8cb91f8a11eff48b8fbd1cef (patch) | |
tree | b560b7b50002060ed393a17e1313d11d690909b2 /tools/pvdisplay.c | |
parent | 223c62e7b727bc8d37c076de256de4a6b68bcacc (diff) | |
download | lvm2-e5f7352bef5c2fcf8cb91f8a11eff48b8fbd1cef.tar.gz |
Convert some vg_reads into vg_lock_and_reads
Diffstat (limited to 'tools/pvdisplay.c')
-rw-r--r-- | tools/pvdisplay.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/tools/pvdisplay.c b/tools/pvdisplay.c index c82ba5987..0528fdbf1 100644 --- a/tools/pvdisplay.c +++ b/tools/pvdisplay.c @@ -20,7 +20,6 @@ static int _pvdisplay_single(struct cmd_context *cmd, struct physical_volume *pv, void *handle) { struct pv_list *pvl; - int consistent = 0; int ret = ECMD_PROCESSED; uint64_t size; @@ -29,21 +28,12 @@ static int _pvdisplay_single(struct cmd_context *cmd, if (!is_orphan(pv) && !vg) { vg_name = pv_vg_name(pv); - if (!lock_vol(cmd, vg_name, LCK_VG_READ)) { - log_error("Can't lock %s: skipping", vg_name); + if (!(vg = vg_lock_and_read(cmd, vg_name, (char *)&pv->vgid, + LCK_VG_READ, CLUSTERED, 0))) { + log_error("Skipping volume group %s", vg_name); return ECMD_FAILED; } - if (!(vg = vg_read(cmd, vg_name, (char *)&pv->vgid, &consistent))) { - log_error("Can't read %s: skipping", vg_name); - goto out; - } - - if (!vg_check_status(vg, CLUSTERED)) { - ret = ECMD_FAILED; - goto out; - } - /* * Replace possibly incomplete PV structure with new one * allocated in vg_read() path. |