Page MenuHomeFreeBSD

Support device-independent labels for geom_flashmap slices.
ClosedPublic

Authored by ian on Mar 10 2019, 11:15 PM.

Details

Summary

While geom_flashmap has always supported label names for its slices, it does so by appending "s.labelname" to the provider device name, meaning you still have to know the name and unit of the hardware device to use the labels.

These changes add support for device-independent geom_flashmap labels, using the standard geom_label infrastructure. geom_flashmap now creates a softc struct attached to its geom, and as it creates slices it stores the label into an array in the softc. The new geom_label_flashmap uses those labels when tasting a geom_flashmap provider.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 22997

Event Timeline

ian created this revision.Mar 10 2019, 11:15 PM
ian updated this revision to Diff 54913.Mar 10 2019, 11:29 PM

Add the required change to sys/conf/files, missed in the first diff.

I like it, just nits, that for the most part you can ignore, other than $FreeBSD: vs $FreeBSD$

sys/geom/geom_flashmap.c
44

This should probably be sorted, or did I miss a dependancy that _slice or _disk need from _flashmap?

sys/geom/geom_flashmap.h
27

$FreeBSD$ not sure why the : is there

sys/geom/label/g_label_flashmap.c
49

Sort variables by name?

rgrimes accepted this revision.Mar 11 2019, 5:16 PM
This revision is now accepted and ready to land.Mar 11 2019, 5:16 PM
ray accepted this revision.Mar 20 2019, 10:05 PM
This revision was automatically updated to reflect the committed changes.