From 7fa91ec044b977785598ef57d8c53af59b2e3782 Mon Sep 17 00:00:00 2001 From: Dave Wysochanski Date: Fri, 10 Jul 2009 20:09:21 +0000 Subject: Move orphan lock obtain/release inside vg_extend(). With this change we now have vgcreate/vgextend liblvm functions. Note that this changes the lock order of the following functions as the orphan lock is now obtained first. With our policy of non-blocking second locks, this should not be a problem. Signed-off-by: Dave Wysochanski --- tools/vgcreate.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'tools/vgcreate.c') diff --git a/tools/vgcreate.c b/tools/vgcreate.c index 7cfd0f29..c41c50f6 100644 --- a/tools/vgcreate.c +++ b/tools/vgcreate.c @@ -46,12 +46,6 @@ int vgcreate(struct cmd_context *cmd, int argc, char **argv) if (validate_vg_create_params(cmd, &vp_new)) return EINVALID_CMD_LINE; - /* FIXME: orphan lock needs tied to vg handle or inside library call */ - if (!lock_vol(cmd, VG_ORPHANS, LCK_VG_WRITE)) { - log_error("Can't get lock for orphan PVs"); - return ECMD_FAILED; - } - /* Create the new VG */ vg = vg_create(cmd, vp_new.vg_name); if (vg_read_error(vg)) @@ -113,7 +107,6 @@ int vgcreate(struct cmd_context *cmd, int argc, char **argv) } unlock_vg(cmd, vp_new.vg_name); - unlock_vg(cmd, VG_ORPHANS); backup(vg); @@ -126,6 +119,5 @@ int vgcreate(struct cmd_context *cmd, int argc, char **argv) bad: vg_release(vg); unlock_vg(cmd, vp_new.vg_name); - unlock_vg(cmd, VG_ORPHANS); return ECMD_FAILED; } -- cgit