From 15db00b53e8f2e136d3f3c0c7fc68fcc48ba0b06 Mon Sep 17 00:00:00 2001 From: Dave Wysochanski Date: Tue, 24 Jun 2008 20:10:32 +0000 Subject: [PATCH] Refactor pv_create() to take cmd_context - no functional change. --- lib/metadata/metadata-exported.h | 2 +- lib/metadata/metadata.c | 4 ++-- tools/pvcreate.c | 2 +- tools/vgconvert.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h index a3c89f6ae..aced42319 100644 --- a/lib/metadata/metadata-exported.h +++ b/lib/metadata/metadata-exported.h @@ -347,7 +347,7 @@ vg_t *vg_lock_and_read(struct cmd_context *cmd, const char *vg_name, /* pe_start and pe_end relate to any existing data so that new metadata * areas can avoid overlap */ -pv_t *pv_create(const struct format_type *fmt, +pv_t *pv_create(const struct cmd_context *cmd, struct device *dev, struct id *id, uint64_t size, diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index 4d919c07e..a82242417 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -747,7 +747,7 @@ int vg_split_mdas(struct cmd_context *cmd __attribute((unused)), * Note: * FIXME - liblvm todo - tidy up arguments for external use (fmt, mdas, etc) */ -pv_t *pv_create(const struct format_type *fmt, +pv_t *pv_create(const struct cmd_context *cmd, struct device *dev, struct id *id, uint64_t size, uint64_t pe_start, @@ -756,7 +756,7 @@ pv_t *pv_create(const struct format_type *fmt, int pvmetadatacopies, uint64_t pvmetadatasize, struct list *mdas) { - return _pv_create(fmt, dev, id, size, pe_start, + return _pv_create(cmd->fmt, dev, id, size, pe_start, existing_extent_count, existing_extent_size, pvmetadatacopies, diff --git a/tools/pvcreate.c b/tools/pvcreate.c index 5661e2ee7..8e771406a 100644 --- a/tools/pvcreate.c +++ b/tools/pvcreate.c @@ -225,7 +225,7 @@ static int pvcreate_single(struct cmd_context *cmd, const char *pv_name, } list_init(&mdas); - if (!(pv = pv_create(cmd->fmt, dev, idp, size, pe_start, + if (!(pv = pv_create(cmd, dev, idp, size, pe_start, extent_count, extent_size, pvmetadatacopies, pvmetadatasize, &mdas))) { log_error("Failed to setup physical volume \"%s\"", pv_name); diff --git a/tools/vgconvert.c b/tools/vgconvert.c index 870363234..6c261f3a4 100644 --- a/tools/vgconvert.c +++ b/tools/vgconvert.c @@ -112,7 +112,7 @@ static int vgconvert_single(struct cmd_context *cmd, const char *vg_name, + pe_start - 1; list_init(&mdas); - if (!(pv = pv_create(cmd->fmt, pv_dev(existing_pv), + if (!(pv = pv_create(cmd, pv_dev(existing_pv), &existing_pv->id, size, pe_start, pv_pe_count(existing_pv), pv_pe_size(existing_pv), pvmetadatacopies,