From 96d0004d12eef62a3b7d64a6ae2d02be84a885f8 Mon Sep 17 00:00:00 2001 From: Dave Wysochanski Date: Fri, 26 Jun 2009 09:47:36 +0000 Subject: Convert the straight instances of vg_lock_and_read to new vg_read(_for_update). Sun May 3 11:40:51 CEST 2009 Petr Rockai * Convert the straight instances of vg_lock_and_read to new vg_read(_for_update). Author: Petr Rockai Committer: Dave Wysochanski --- tools/pvresize.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'tools/pvresize.c') diff --git a/tools/pvresize.c b/tools/pvresize.c index 3b5f1493..82c79368 100644 --- a/tools/pvresize.c +++ b/tools/pvresize.c @@ -29,7 +29,6 @@ static int _pv_resize_single(struct cmd_context *cmd, const uint64_t new_size) { struct pv_list *pvl; - int consistent = 1; uint64_t size = 0; uint32_t new_pe_count = 0; int r = 0; @@ -59,19 +58,9 @@ static int _pv_resize_single(struct cmd_context *cmd, } else { vg_name = pv_vg_name(pv); - if (!lock_vol(cmd, vg_name, LCK_VG_WRITE)) { - log_error("Can't get lock for %s", pv_vg_name(pv)); - return 0; - } - - if (!(vg = vg_read_internal(cmd, vg_name, NULL, &consistent))) { - unlock_vg(cmd, vg_name); - log_error("Unable to find volume group of \"%s\"", - pv_name); - return 0; - } + vg = vg_read_for_update(cmd, vg_name, NULL, 0); - if (!vg_check_status(vg, CLUSTERED | EXPORTED_VG | LVM_WRITE)) + if (vg_read_error(vg)) goto bad; if (!(pvl = find_pv_in_vg(vg, pv_name))) { -- cgit