diff options
author | Milan Broz <mbroz@redhat.com> | 2009-02-25 23:29:06 +0000 |
---|---|---|
committer | Milan Broz <mbroz@redhat.com> | 2009-02-25 23:29:06 +0000 |
commit | 7b1c853bd901477a99161a4f6e05bee461c490dc (patch) | |
tree | 4d5d6d740f46535c500a41ebad88114d6e04aa3d /tools | |
parent | edf47283de397e86055086e19d3012d0c02602d0 (diff) | |
download | lvm2-7b1c853bd901477a99161a4f6e05bee461c490dc.tar.gz lvm2-7b1c853bd901477a99161a4f6e05bee461c490dc.tar.xz lvm2-7b1c853bd901477a99161a4f6e05bee461c490dc.zip |
Try to avoid full rescan if label scan is enough.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/pvchange.c | 6 | ||||
-rw-r--r-- | tools/pvcreate.c | 4 | ||||
-rw-r--r-- | tools/pvremove.c | 4 | ||||
-rw-r--r-- | tools/pvresize.c | 2 | ||||
-rw-r--r-- | tools/toollib.c | 7 |
5 files changed, 12 insertions, 11 deletions
diff --git a/tools/pvchange.c b/tools/pvchange.c index d1f7fd08..1ca73638 100644 --- a/tools/pvchange.c +++ b/tools/pvchange.c @@ -97,7 +97,7 @@ static int _pvchange_single(struct cmd_context *cmd, struct physical_volume *pv, return 0; } - if (!(pv = pv_read(cmd, pv_name, NULL, §or, 1))) { + if (!(pv = pv_read(cmd, pv_name, NULL, §or, 1, 0))) { unlock_vg(cmd, vg_name); log_error("Unable to read PV \"%s\"", pv_name); return 0; @@ -251,7 +251,7 @@ int pvchange(struct cmd_context *cmd, int argc, char **argv) for (; opt < argc; opt++) { pv_name = argv[opt]; dm_list_init(&mdas); - if (!(pv = pv_read(cmd, pv_name, &mdas, NULL, 1))) { + if (!(pv = pv_read(cmd, pv_name, &mdas, NULL, 1, 0))) { log_error("Failed to read physical volume %s", pv_name); continue; @@ -270,7 +270,7 @@ int pvchange(struct cmd_context *cmd, int argc, char **argv) continue; } if (!(pv = pv_read(cmd, pv_name, - NULL, NULL, 1))) { + NULL, NULL, 1, 0))) { log_error("Failed to read " "physical volume %s", pv_name); diff --git a/tools/pvcreate.c b/tools/pvcreate.c index 28522139..8ec95f45 100644 --- a/tools/pvcreate.c +++ b/tools/pvcreate.c @@ -50,7 +50,7 @@ static int pvcreate_check(struct cmd_context *cmd, const char *name, /* FIXME Check partition type is LVM unless --force is given */ /* Is there a pv here already? */ - pv = pv_read(cmd, name, NULL, NULL, 0); + pv = pv_read(cmd, name, NULL, NULL, 0, 0); /* * If a PV has no MDAs it may appear to be an orphan until the @@ -61,7 +61,7 @@ static int pvcreate_check(struct cmd_context *cmd, const char *name, if (pv && is_orphan(pv)) { if (!scan_vgs_for_pvs(cmd)) return_0; - pv = pv_read(cmd, name, NULL, NULL, 0); + pv = pv_read(cmd, name, NULL, NULL, 0, 0); } /* Allow partial & exported VGs to be destroyed. */ diff --git a/tools/pvremove.c b/tools/pvremove.c index 9912711c..3d754807 100644 --- a/tools/pvremove.c +++ b/tools/pvremove.c @@ -33,7 +33,7 @@ static int pvremove_check(struct cmd_context *cmd, const char *name) /* Is there a pv here already? */ /* If not, this is an error unless you used -f. */ - if (!(pv = pv_read(cmd, name, &mdas, NULL, 1))) { + if (!(pv = pv_read(cmd, name, &mdas, NULL, 1, 0))) { if (arg_count(cmd, force_ARG)) return 1; log_error("Physical Volume %s not found", name); @@ -53,7 +53,7 @@ static int pvremove_check(struct cmd_context *cmd, const char *name) "failed."); return 0; } - if (!(pv = pv_read(cmd, name, NULL, NULL, 1))) { + if (!(pv = pv_read(cmd, name, NULL, NULL, 1, 0))) { log_error("Failed to read physical volume %s", name); return 0; } diff --git a/tools/pvresize.c b/tools/pvresize.c index f0a6471b..1ff0a92a 100644 --- a/tools/pvresize.c +++ b/tools/pvresize.c @@ -47,7 +47,7 @@ static int _pv_resize_single(struct cmd_context *cmd, return 0; } - if (!(pv = pv_read(cmd, pv_name, &mdas, NULL, 1))) { + if (!(pv = pv_read(cmd, pv_name, &mdas, NULL, 1, 0))) { unlock_vg(cmd, vg_name); log_error("Unable to read PV \"%s\"", pv_name); return 0; diff --git a/tools/toollib.c b/tools/toollib.c index c51bc95e..1a2fd01e 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -600,7 +600,7 @@ static int _process_all_devs(struct cmd_context *cmd, void *handle, } while ((dev = dev_iter_get(iter))) { - if (!(pv = pv_read(cmd, dev_name(dev), NULL, NULL, 0))) { + if (!(pv = pv_read(cmd, dev_name(dev), NULL, NULL, 0, 0))) { memset(&pv_dummy, 0, sizeof(pv_dummy)); dm_list_init(&pv_dummy.tags); dm_list_init(&pv_dummy.segments); @@ -676,7 +676,7 @@ int process_each_pv(struct cmd_context *cmd, int argc, char **argv, pv = pvl->pv; } else { if (!(pv = pv_read(cmd, argv[opt], NULL, - NULL, 1))) { + NULL, 1, scan_label_only))) { log_error("Failed to read physical " "volume \"%s\"", argv[opt]); ret_max = ECMD_FAILED; @@ -699,7 +699,8 @@ int process_each_pv(struct cmd_context *cmd, int argc, char **argv, } scanned = 1; if (!(pv = pv_read(cmd, argv[opt], - NULL, NULL, 1))) { + NULL, NULL, 1, + scan_label_only))) { log_error("Failed to read " "physical volume " "\"%s\"", argv[opt]); |