From: Petr Rockai <prockai@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH 10/17] Add pe_start_locked parameter to pv_create fn.
Date: Fri, 28 Jan 2011 17:39:56 +0100 [thread overview]
Message-ID: <87k4hpoucj.fsf@twilight.int.mornfall.net.> (raw)
In-Reply-To: <1295867048-21558-11-git-send-email-prajnoha@redhat.com> (Peter Rajnoha's message of "Mon, 24 Jan 2011 12:04:01 +0100")
Peter Rajnoha <prajnoha@redhat.com> writes:
> So we can define and hint the metadata area handling code that the
> pe_start is supposed to be firmly set to a certain value and it should
> not be changed during calculations.
All clear. However, it adds another parameter to an already huge
list. Please consider other options. Also, not using int as a bool would
help in lots of places, but I guess we are stuck with that. (You could
for example create a structure for the parameters, so at least at the
call site, we have know which parameter means what... having a 10-tuple
of integers is not exactly informative.)
> Signed-off-by: Peter Rajnoha <prajnoha@redhat.com>
Reviewed-by: Petr Rockai <prockai@redhat.com>
> ---
> lib/metadata/metadata-exported.h | 1 +
> lib/metadata/metadata.c | 4 +++-
> tools/vgconvert.c | 2 +-
> 3 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
> index da62764..627d098 100644
> --- a/lib/metadata/metadata-exported.h
> +++ b/lib/metadata/metadata-exported.h
> @@ -394,6 +394,7 @@ struct physical_volume *pv_create(const struct cmd_context *cmd,
> unsigned long data_alignment,
> unsigned long data_alignment_offset,
> uint64_t pe_start,
> + int pe_start_locked,
> uint32_t existing_extent_count,
> uint32_t existing_extent_size,
> int pvmetadatacopies, uint64_t pvmetadatasize,
> diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
> index 591f7b5..419dcfc 100644
> --- a/lib/metadata/metadata.c
> +++ b/lib/metadata/metadata.c
> @@ -1486,7 +1486,8 @@ struct physical_volume * pvcreate_single(struct cmd_context *cmd,
> dm_list_init(&mdas);
> if (!(pv = pv_create(cmd, dev, pp->idp, pp->size,
> pp->data_alignment, pp->data_alignment_offset,
> - pp->pe_start, pp->extent_count, pp->extent_size,
> + pp->pe_start, pp->pe_start ? 1 : 0,
> + pp->extent_count, pp->extent_size,
> pp->pvmetadatacopies, pp->pvmetadatasize,
> pp->metadataignore, &mdas))) {
> log_error("Failed to setup physical volume \"%s\"", pv_name);
> @@ -1591,6 +1592,7 @@ struct physical_volume *pv_create(const struct cmd_context *cmd,
> unsigned long data_alignment,
> unsigned long data_alignment_offset,
> uint64_t pe_start,
> + int pe_start_locked,
> uint32_t existing_extent_count,
> uint32_t existing_extent_size,
> int pvmetadatacopies, uint64_t pvmetadatasize,
> diff --git a/tools/vgconvert.c b/tools/vgconvert.c
> index acae0fc..81ff616 100644
> --- a/tools/vgconvert.c
> +++ b/tools/vgconvert.c
> @@ -125,7 +125,7 @@ static int vgconvert_single(struct cmd_context *cmd, const char *vg_name,
> dm_list_init(&mdas);
> if (!(pv = pv_create(cmd, pv_dev(existing_pv),
> &existing_pv->id, size, 0, 0,
> - pe_start, pv_pe_count(existing_pv),
> + pe_start, 1, pv_pe_count(existing_pv),
> pv_pe_size(existing_pv), pvmetadatacopies,
> pvmetadatasize, 0, &mdas))) {
> log_error("Failed to setup physical volume \"%s\"",
next prev parent reply other threads:[~2011-01-28 16:39 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-24 11:03 [PATCH 00/17] Add interface to support adding and removing metadata areas on demand (v2) Peter Rajnoha
2011-01-24 11:03 ` [PATCH 01/17] Add pvid parameter to create_instance function Peter Rajnoha
2011-01-25 12:54 ` Petr Rockai
2011-01-24 11:03 ` [PATCH 02/17] Add supporting functions for metadata areas stored in format instance Peter Rajnoha
2011-01-25 13:16 ` Petr Rockai
2011-01-26 10:38 ` Peter Rajnoha
2011-01-26 13:59 ` Petr Rockai
2011-01-26 14:06 ` Petr Rockai
2011-01-24 11:03 ` [PATCH 03/17] Add struct format_instance *fid field to struct physical_volume Peter Rajnoha
2011-01-25 13:03 ` Petr Rockai
2011-01-24 11:03 ` [PATCH 04/17] Add format_instance support for pv_read Peter Rajnoha
2011-01-25 13:30 ` Petr Rockai
2011-01-26 11:05 ` Peter Rajnoha
2011-01-26 11:12 ` Peter Rajnoha
2011-01-24 11:03 ` [PATCH 05/17] Add attach_existing_mdas parameter to create_instance fn Peter Rajnoha
2011-01-25 14:43 ` Petr Rockai
2011-01-26 13:24 ` Peter Rajnoha
2011-01-24 11:03 ` [PATCH 06/17] Remove useless mdas parameter from PV read functions Peter Rajnoha
2011-01-25 14:44 ` Petr Rockai
2011-01-24 11:03 ` [PATCH 07/17] Add pv_add_metadata_area fn to support adding metadata areas on demand Peter Rajnoha
2011-01-25 14:48 ` Petr Rockai
2011-01-24 11:03 ` [PATCH 08/17] Add pv_remove_metadata_area fn to support removing " Peter Rajnoha
2011-01-28 15:31 ` Petr Rockai
2011-01-24 11:04 ` [PATCH 09/17] Add pv_initialise fn to format_handler interface Peter Rajnoha
2011-01-28 16:31 ` Petr Rockai
2011-01-24 11:04 ` [PATCH 10/17] Add pe_start_locked parameter to pv_create fn Peter Rajnoha
2011-01-28 16:39 ` Petr Rockai [this message]
2011-01-24 11:04 ` [PATCH 11/17] Refactor pv_setup to not include the PV initialisation code Peter Rajnoha
2011-01-24 11:04 ` [PATCH 12/17] Remove unused _mda_setup code Peter Rajnoha
2011-01-24 11:04 ` [PATCH 13/17] Cleanup pv_write code to use recent changes in metadata handling interface Peter Rajnoha
2011-01-24 11:04 ` [PATCH 14/17] Use new metadata handling interface to provide better support for PV resize Peter Rajnoha
2011-01-24 11:04 ` [PATCH 15/17] Change vg_convert code to actually work with recent changes in metadata handling interface Peter Rajnoha
2011-01-24 11:04 ` [PATCH 16/17] Fix pvchange -u to " Peter Rajnoha
2011-01-24 16:04 ` Peter Rajnoha
2011-01-24 11:04 ` [PATCH 17/17] Fix pvchange --metadataignore " Peter Rajnoha
2011-01-24 11:12 ` [PATCH 00/17] Add interface to support adding and removing metadata areas on demand (v2) Peter Rajnoha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k4hpoucj.fsf@twilight.int.mornfall.net. \
--to=prockai@redhat.com \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.