Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jun 2010 13:11:23 +0400
From:      "Andrey V. Elsukov" <bu7cher@yandex.ru>
To:        freebsd-geom@freebsd.org
Cc:        Alexander Motin <mav@FreeBSD.org>, Marcel Moolenaar <marcel@FreeBSD.org>, Konstantin Belousov <kib@FreeBSD.org>
Subject:   RFC: make gpart(8) sector size aware
Message-ID:  <4C1743BB.6030105@yandex.ru>

index | next in thread | raw e-mail

[-- Attachment #1 --]
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.

My patch is here:
http://people.freebsd.org/~ae/gpart_sectorsize.diff

Also I replaced `unsigned long long` type for `off_t` for unify code since
it seems off_t used for media size in libgeom(8) and for DIOCGMEDIASIZE ioctl.

-- 
WBR, Andrey V. Elsukov


[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)

iQEcBAEBAgAGBQJMF0PAAAoJEAHF6gQQyKF6FTMH/3+EXSSDKBwvYbOInygo5R0M
7jgpbR4FYrVNsSkZcsZthHgiA5hg7QeS7ytbfTcaPx1fpz/QtOui6wBBhXqV/D/J
z+yPmVoQKG/RAVgz+S9Geo4Mw43LZbwj0yMvw+kiSI6mnxREudCuIptGluUTe5I7
oqW0/AXVAkL9SI82tecVIz+Gh857vqicpEXkyQrwDZL5nmujkrJhm2Gq2wa0aogu
nrD0YMAIyrG1BcMdkytLUO6HTjHh8LhVGwQnjBkyB+8pI9XoNSt3rFF4Pjfp7nwM
sZNf+/DxF58GEFaqqGdiqQPd33AW5lpxyNGMgcw/mc5wECi+oEONfGd9iZrFelY=
=GCHj
-----END PGP SIGNATURE-----
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C1743BB.6030105>