1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
lvm2/lib/metadata
David Teigland 71671778ab toollib: add two phase pv processing code
This is common code for handling PV create/remove
that can be shared by pvcreate/vgcreate/vgextend/pvremove.
This does not change any commands to use the new code.

- Pull out the hidden equivalent of process_each_pv
  into an actual top level process_each_pv.

- Pull the prompts to the top level, and do not
  run any prompts while locks are held.
  The orphan lock is reacquired after any prompts are
  done, and the devices being created are checked for
  any change made while the lock was not held.

Previously, pvcreate_vol() was the shared function for
creating a PV for pvcreate, vgcreate, vgextend.
Now, it will be toollib function pvcreate_each_device().

pvcreate_vol() was called effectively as a helper, from
within vgcreate and vgextend code paths.
pvcreate_each_device() will be called at the same level
as other process_each functions.

One of the main problems with pvcreate_vol() is that
it included a hidden equivalent of process_each_pv for
each device being created:

  pvcreate_vol() -> _pvcreate_check() ->

   find_pv_by_name() -> get_pvs() ->

     get_pvs_internal() -> _get_pvs() -> get_vgids() ->

       /* equivalent to process_each_pv */
       dm_list_iterate_items(vgids)
         vg = vg_read_internal()
         dm_list_iterate_items(&vg->pvs)

pvcreate_each_device() reorganizes the code so that
each-VG-each-PV loop is done once, and uses the standard
process_each_pv function at the top level of the function.
2016-02-25 09:14:09 -06:00
..
cache_manip.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lv_alloc.h doc: change fsf address 2016-01-21 12:11:37 +01:00
lv_manip.c coverity: ensure thin_pool_seg is not NULL 2016-02-23 21:40:17 +01:00
lv.c thin: report needs_check and fail state 2016-02-18 16:49:34 +01:00
lv.h doc: change fsf address 2016-01-21 12:11:37 +01:00
merge.c doc: change fsf address 2016-01-21 12:11:37 +01:00
metadata-exported.h toollib: add two phase pv processing code 2016-02-25 09:14:09 -06:00
metadata.c toollib: add two phase pv processing code 2016-02-25 09:14:09 -06:00
metadata.h metadata: refactor part of add_pv_to_vg 2016-02-25 09:14:09 -06:00
mirror.c doc: change fsf address 2016-01-21 12:11:37 +01:00
pool_manip.c doc: change fsf address 2016-01-21 12:11:37 +01:00
pv_alloc.h doc: change fsf address 2016-01-21 12:11:37 +01:00
pv_manip.c pvremove: add warn when removing PV in use 2016-02-23 14:40:30 +01:00
pv_map.c doc: change fsf address 2016-01-21 12:11:37 +01:00
pv_map.h doc: change fsf address 2016-01-21 12:11:37 +01:00
pv.c pv: use pv->fmt to check for fake PVs, not pv->vg 2016-02-15 15:52:13 +01:00
pv.h pv: add is_used_pv fn 2016-02-15 12:44:46 +01:00
raid_manip.c gcc: cleanup some sign warnings 2016-02-23 12:25:25 +01:00
replicator_manip.c doc: change fsf address 2016-01-21 12:11:37 +01:00
segtype.c doc: change fsf address 2016-01-21 12:11:37 +01:00
segtype.h doc: change fsf address 2016-01-21 12:11:37 +01:00
snapshot_manip.c doc: change fsf address 2016-01-21 12:11:37 +01:00
thin_manip.c gcc: cleanup some sign warnings 2016-02-23 12:25:25 +01:00
vg.c vg_write: add list of pvs to write 2016-02-25 09:14:09 -06:00
vg.h vg_write: add list of pvs to write 2016-02-25 09:14:09 -06:00