A replacement for GEOM_LABEL's gpt/gptid

Andrey V. Elsukov ae at FreeBSD.org
Mon Apr 25 11:09:13 UTC 2011


Hello All.

I wrote a small extension for the GEOM_PART class. It adds an ability
to GEOM_PART class to create partition labels for schemes which are
support them.

Currently we have GEOM_LABEL class which does similar functions,
but it has problems in conjunction with GEOM_PART (e.g. kern/154226).
Current implementation of GEOM_LABEL's gpt/gptid module does direct
access to GEOM_PART object structures, that seems not so good for me.

So, my patch contains:

* new GEOM class "PART::LABEL". It attaches to partition provider and
create new providers for each label.

* new kobj method - G_PART_LABELS. It called when new partition is creating.
A partition scheme can implement this method if it supports partition labels.
Method should just call g_part_create_label() function to create new label for
given partition.

* g_part_spoil_labels() function. It called from GEOM_PART to destroy labels
providers or mark them stale. At this time it called only from "gpart modify"
method.

What differs from GEOM_LABEL:

* PART::LABEL class has not ".spoiled" method and all providers are persistent.

* if label is changing while provider is in use, it will not be destroyed until
access does not released, but new label will become available.

* also it has support for APM and PC98 schemes.

The patch is here:
http://people.freebsd.org/~ae/gpart_labels.diff

Since it conflicts with GEOM_LABEL's gpt/gptid to test patch you should
disable gpt/gptid module, it can be done via loader.conf:

kern.geom.label.gptid.enable="0"
kern.geom.label.gpt.enable="0"

-- 
WBR, Andrey V. Elsukov

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20110425/20a212f5/signature.pgp


More information about the freebsd-geom mailing list