diff options
author | Tony Asleson <tasleson@redhat.com> | 2013-04-03 17:53:21 -0400 |
---|---|---|
committer | Tony Asleson <tasleson@redhat.com> | 2013-07-02 14:24:34 -0500 |
commit | 6d6ccded3590b46f214561db38e1ce084b643c13 (patch) | |
tree | 2b6f6ade3abb7ff31432af37eb7f9f09740cae9d /tools/pvcreate.c | |
parent | d079411051e8151b61c7614e791215db065c01cb (diff) | |
download | lvm2-6d6ccded3590b46f214561db38e1ce084b643c13.tar.gz |
lib2app: Added PV create. V2
V2: Correct call to lock_vol
Signed-off-by: Tony Asleson <tasleson@redhat.com>
Diffstat (limited to 'tools/pvcreate.c')
-rw-r--r-- | tools/pvcreate.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/tools/pvcreate.c b/tools/pvcreate.c index 7570c5203..d2de4d9a1 100644 --- a/tools/pvcreate.c +++ b/tools/pvcreate.c @@ -15,6 +15,7 @@ #include "tools.h" #include "metadata-exported.h" +#include "metadata.h" /* * Intial sanity checking of recovery-related command-line arguments. @@ -96,7 +97,6 @@ int pvcreate(struct cmd_context *cmd, int argc, char **argv) int i; int ret = ECMD_PROCESSED; struct pvcreate_params pp; - struct physical_volume *pv; pvcreate_params_set_defaults(&pp); @@ -108,19 +108,12 @@ int pvcreate(struct cmd_context *cmd, int argc, char **argv) } for (i = 0; i < argc; i++) { - if (!lock_vol(cmd, VG_ORPHANS, LCK_VG_WRITE, NULL)) { - log_error("Can't get lock for orphan PVs"); - return ECMD_FAILED; - } - dm_unescape_colons_and_at_signs(argv[i], NULL, NULL); - if (!(pv = pvcreate_single(cmd, argv[i], &pp, 1))) { - stack; + if (ECMD_PROCESSED != pvcreate_locked(cmd, argv[i], &pp)) { ret = ECMD_FAILED; } - unlock_vg(cmd, VG_ORPHANS); if (sigint_caught()) return ret; } |