[lvm-devel] [PATCH 5/5] Add pv->vg to solidify link between a pv and a vg.

Alasdair G Kergon agk at redhat.com
Tue Apr 6 13:27:57 UTC 2010


On Mon, Apr 05, 2010 at 03:51:39PM -0400, Dave Wysochanski wrote:
> +++ b/lib/metadata/metadata-exported.h
> @@ -184,6 +184,7 @@ struct physical_volume {
>  	const char *vg_name;
>  	struct id vgid;
>  
> +	struct volume_group *vg;
>  	uint64_t status;
>  	uint64_t size;
 
Put it at the end of the other group i.e. move the blank line.

There are now *three* entries in the PV struct referring to the VG.
- vg_name
- vgid
- vg

Why do we need 3?
- Historically, only the name was used.
- We added vgid to distinguish between different VGs with the same name plugged
into a system.
- The new 'vg' field as proposed is *independent* of those two existing ones, and
is set and maintained when the PV belongs to a 'pvs' list in a parent VG struct.
Please make that clear in a comment by the field.

Alasdair




More information about the lvm-devel mailing list