Accessing disks via their serial numbers.

Robert Watson rwatson at FreeBSD.org
Mon Jun 26 08:15:43 UTC 2006


On Mon, 26 Jun 2006, Pawel Jakub Dawidek wrote:

> On Mon, Jun 26, 2006 at 06:51:37AM +0000, Poul-Henning Kamp wrote:
>> In message <20060626031636.GK82074 at funkthat.com>, John-Mark Gurney writes:
>>
>>> Can't we expand the disk api?  add a const char *d_serial to the struct
>>> disk, and have the disk api automaticly propegate the serial number up
>>> to the geom layer?
>>
>> This is more or less what Pawel asked me for, and I am not at all
>> convinced that is how we want to do it.
>
> Actually I proposed the opposite: remove some d_* fields and make them 
> available via discussed mechanism.

Yes -- one of the problems/benefits of the disk(9) API is that it's a very 
narrow API.  I'd like to see an attribute API pushed into disk(9) so that GEOM 
modules can query additional disk properties in much the same way they can 
query GEOM attributes.  However, I think that we should not move existing 
mandatory fields out if they really are mandatory -- right now the API 
guarantees that certain values will always be available, and will not change. 
By re-exposing them via an attribute interface, we allow for the possibility 
of them being unavailable or changing.  GEOM univerally provides similar 
guarantees, such as sectorsize not changing.  Media size is a slightly more 
dubious one, of course, and probably should become variable.

Robert N M Watson
Computer Laboratory
University of Cambridge


More information about the freebsd-arch mailing list