From: Peter Rajnoha <prajnoha@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] Refactor lib/ code to allow deferred PV labelling
Date: Thu, 28 Apr 2011 11:01:13 +0200 [thread overview]
Message-ID: <4DB92CD9.1060508@redhat.com> (raw)
In-Reply-To: <20110427182420.GD32370@agk-dp.fab.redhat.com>
On 04/27/2011 08:24 PM +0100, Alasdair G Kergon wrote:
>> @@ -51,6 +51,9 @@ struct physical_volume {
>
>> + /* NB. Only useful/used when status & UNLABELLED_PV! */
>> + int64_t label_sector;
>
>> @@ -59,6 +65,13 @@ struct volume_group {
>> + struct dm_list pvs_to_create;
>
> These are really just temporary places to store things - not used as an intrinsic
> part of the structs themselves. How difficult is it to handle them
> separately outside the structs?
Well, normally, we store that in PV-based format instance context
(the 'struct text_fid_pv_context' that is stored in 'private' field in
'struct format_instance). But if that PV is part of the VG, we use a
common VG-based format instance - so we can't store that PV info there
separately for each PV...
So how about using 'struct pvcreate_params' we attach to 'struct pv_to_create'
in add_pv_to_vg fn:
if (pv->status & UNLABELLED_PV) {
if (!(pvc = dm_pool_zalloc(mem, sizeof(*pvc)))) {
log_error("pv_to_create allocation for '%s' failed", pv_name);
return 0;
}
pvc->pv = pv;
pvc->pp = pp;
...
...
Can we use that to store that label sector info? Would that work?
If we don't find a place for that label sector other than the struct PV
itself as proposed in this patch, we can also remove the 'struct text_fid_pv_context'.
The text_fid_pv_context is here to store the label_sector info only. At least for now.
I wanted to use the PV struct for that as well the other day, like you do here... ;)
It's useless to store that in two places at the same time.
Peter
next prev parent reply other threads:[~2011-04-28 9:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-27 12:08 [PATCH] Refactor lib/ code to allow deferred PV labelling Petr Rockai
2011-04-27 18:24 ` Alasdair G Kergon
2011-04-28 9:01 ` Peter Rajnoha [this message]
2011-04-29 17:55 ` Petr Rockai
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=4DB92CD9.1060508@redhat.com \
--to=prajnoha@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.