From: wysochanski@sourceware.org <wysochanski@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2/tools lvconvert.c lvrename.c
Date: 23 Jul 2007 22:20:43 -0000 [thread overview]
Message-ID: <20070723222043.16274.qmail@sourceware.org> (raw)
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: wysochanski at sourceware.org 2007-07-23 22:20:42
Modified files:
tools : lvconvert.c lvrename.c
Log message:
Update lvconvert and lvrename to use vg_lock_and_read
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.28&r2=1.29
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvrename.c.diff?cvsroot=lvm2&r1=1.43&r2=1.44
--- LVM2/tools/lvconvert.c 2007/06/28 17:33:44 1.28
+++ LVM2/tools/lvconvert.c 2007/07/23 22:20:41 1.29
@@ -534,7 +534,6 @@
int lvconvert(struct cmd_context * cmd, int argc, char **argv)
{
- int consistent = 1;
struct volume_group *vg;
struct lv_list *lvl;
struct lvconvert_params lp;
@@ -547,18 +546,10 @@
log_verbose("Checking for existing volume group \"%s\"", lp.vg_name);
- if (!lock_vol(cmd, lp.vg_name, LCK_VG_WRITE)) {
- log_error("Can't get lock for %s", lp.vg_name);
+ if (!(vg = vg_lock_and_read(cmd, lp.vg_name, LCK_VG_WRITE,
+ CLUSTERED | EXPORTED_VG | LVM_WRITE,
+ CORRECT_INCONSISTENT)))
return ECMD_FAILED;
- }
-
- if (!(vg = vg_read(cmd, lp.vg_name, NULL, &consistent))) {
- log_error("Volume group \"%s\" doesn't exist", lp.vg_name);
- goto error;
- }
-
- if (!vg_check_status(vg, CLUSTERED | EXPORTED_VG | LVM_WRITE))
- goto error;
if (!(lvl = find_lv_in_vg(vg, lp.lv_name))) {
log_error("Logical volume \"%s\" not found in "
--- LVM2/tools/lvrename.c 2007/06/06 19:40:28 1.43
+++ LVM2/tools/lvrename.c 2007/07/23 22:20:42 1.44
@@ -22,7 +22,6 @@
char *lv_name_old, *lv_name_new;
const char *vg_name, *vg_name_new, *vg_name_old;
char *st;
- int consistent = 1;
struct volume_group *vg;
struct logical_volume *lv;
@@ -99,18 +98,10 @@
log_verbose("Checking for existing volume group \"%s\"", vg_name);
- if (!lock_vol(cmd, vg_name, LCK_VG_WRITE)) {
- log_error("Can't get lock for %s", vg_name);
+ if (!(vg = vg_lock_and_read(cmd, vg_name, LCK_VG_WRITE,
+ CLUSTERED | EXPORTED_VG | LVM_WRITE,
+ CORRECT_INCONSISTENT)))
return ECMD_FAILED;
- }
-
- if (!(vg = vg_read(cmd, vg_name, NULL, &consistent))) {
- log_error("Volume group \"%s\" doesn't exist", vg_name);
- goto error;
- }
-
- if (!vg_check_status(vg, CLUSTERED | EXPORTED_VG | LVM_WRITE))
- goto error;
if (find_lv_in_vg(vg, lv_name_new)) {
log_error("Logical volume \"%s\" already exists in "
reply other threads:[~2007-07-23 22:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070723222043.16274.qmail@sourceware.org \
--to=wysochanski@sourceware.org \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.