summaryrefslogtreecommitdiff
path: root/tools/pvchange.c
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2015-12-15 12:55:48 -0600
committerDavid Teigland <teigland@redhat.com>2016-01-07 13:39:25 -0600
commit0b1526eae1d5803549720f403d5324fdd8f758ad (patch)
tree4dedf17839a64fa8f3d2fbfac3386eebfa794d77 /tools/pvchange.c
parent4304a95dfdb4791e23dbd4b0280c667eba5cb664 (diff)
downloadlvm2-0b1526eae1d5803549720f403d5324fdd8f758ad.tar.gz
pvcreate, vgcreate, vgextend: restructuring to use toollibdev-dct-pvcreate-8
- 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 the 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.
Diffstat (limited to 'tools/pvchange.c')
-rw-r--r--tools/pvchange.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/pvchange.c b/tools/pvchange.c
index 91e93c1e7..da5a4a86a 100644
--- a/tools/pvchange.c
+++ b/tools/pvchange.c
@@ -213,7 +213,7 @@ int pvchange(struct cmd_context *cmd, int argc, char **argv)
}
}
- ret = process_each_pv(cmd, argc, argv, NULL, READ_FOR_UPDATE, handle, _pvchange_single);
+ ret = process_each_pv(cmd, argc, argv, NULL, 0, READ_FOR_UPDATE, handle, _pvchange_single);
if (!argc)
unlock_vg(cmd, VG_GLOBAL);