Subject: Re: disklabel handling functions
To: Tyler Retzlaff <rtr@wasabisystems.com>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 10/31/2002 13:09:36
On Thu, 31 Oct 2002, Tyler Retzlaff wrote:

> In an effort to be able to handle disklabels more easily from within programs
> that use them I have put together some functions that I'd like to incorporate
> into a lib.  It's been suggested that the best place to put them would be
> libutil (or possibly a new lib libdklabel).

I'd say make it a new library.

> I'd like to get some other people to look over the functions and let me know
> what else needs to be done to them before they are suitable to be imported.
> For the moment I only have knowledge of i386 and they have been tested there
> but they have been written flexibly to account for any platform specific
> quirks I don't know about.

Looking at dknotes:

disklabel_write_incore() - you were seeing how different drivers handle
final close. sd drives look at PERIPH_MEDIA_LOADED to know if they should
re-read a label. If PERIPH_KEEP_LABEL is set, PERIPH_MEDIA_LOADED isn't
cleared on final close().

Also look at the DIOCKLABEL ioctl:

#define DIOCKLABEL      _IOW('d', 119, int)     /* keep/drop label on close? */


disklabel_validate():

An error code would be better than a count.

A machine (not arch) indicator would probably be good.


Actually, BBSIZE is file system dependent. :-)

Take care,

Bill