]> sourceware.org Git - lvm2.git/commit
vgcreate: use the common toollib pv create
authorDavid Teigland <teigland@redhat.com>
Tue, 26 Jan 2016 17:34:59 +0000 (11:34 -0600)
committerDavid Teigland <teigland@redhat.com>
Thu, 25 Feb 2016 15:14:09 +0000 (09:14 -0600)
commita9940bd3c928598d1f15a60503c146046e55a357
treedec9a4af53a07eba8cda72779bad4130f0c9863a
parent749a7cecf895264bb8b924e2cc091d13cb111965
vgcreate: use the common toollib pv create

Use the new pvcreate_each_device() function from
toollib, previously added for pvcreate, in place
of the old pvcreate_vol().

This also requires shifting the location where the
lock is acquired for the new VG name.  The lock for
the new VG is supposed to be acquired before pvcreate.
This means splitting the vg_lock_newname() out of
vg_create(), and calling vg_lock_newname() directly
before pvcreate, and then calling the remainder of
vg_create() after pvcreate.

The new function vg_lock_and_create() now does
vg_lock_newname() + vg_create(), like the previous
version of vg_create().

The lock on the new VG name is released before the
pvcreate and reacquired after the pvcreate because
pvcreate needs to reset lvmcache, which doesn't work
when locks are held.  An exception could likely be
made for the new VG name lock, which would allow
vgcreate to hold the new VG name lock across the
pvcreate step.
lib/metadata/metadata-exported.h
lib/metadata/metadata.c
liblvm/lvm_vg.c
tools/vgcreate.c
tools/vgsplit.c
This page took 0.040883 seconds and 5 git commands to generate.