RFC: make gpart(8) sector size aware

Marcel Moolenaar xcllnt at mac.com
Tue Jun 15 23:04:16 UTC 2010


On Jun 15, 2010, at 2:11 AM, Andrey V. Elsukov wrote:

> Hi, All.
> 
> I made a patch that makes gpart(8) sector size aware.
> There is a known issue described in bin/146277.
> 
> gpart(8) uses type ASCLBA for size-related params and it doesn't know
> about provider's sector size when geom(8) parses arguments. By default
> it assumes that sector size is 512 bytes. And when user specifies size or
> start offset params in humanized form they being calculated into sectors
> incorrectly.
> 
> It seems that only gpart(8) uses G_TYPE_ASCLBA and there are none of another
> consumers, so I deleted this type and replace it to G_TYPE_STRING. And now
> gpart(8) converts size-related params after geom(8) when it can know provider's
> sector size.

Overall the approach is good, but it does go against what I think
is the intend of geom and that is that gctl creating is handled
in common code using the the tables. That's also why I introduced
G_TYPE_ASCLBA. I'm fine with using G_TYPE_STRING and adding a bit
of post-processing.

FYI,

-- 
Marcel Moolenaar
xcllnt at mac.com





More information about the freebsd-geom mailing list