Subject: readdisklabel parameter change
To: None <tech-kern@netbsd.org>
From: Frank van der Linden <frank@wins.uva.nl>
List: tech-kern
Date: 09/05/1999 22:33:31
Currently, readdisklabel is prototyped as being:
char *readdisklabel __P((dev_t, void (*)(struct buf *),
struct disklabel *, struct cpu_disklabel *));
It returns an error string in case of an error, and NULL if all is well.
However, sometimes you may want to print multiple errors from readdisklabel
itself. For example, if you check for overlapping partitions in a
DIAGNOSTIC case. Or, in the i386 case, for overlapping MBR partitions, etc.
For these warnings to be useful, you need the device name. There is already a
warning in the i386 readdisklabel code saying "Old MBR type", which isn't
very useful because it doesn't include the diskname.
So, I want to change readdisklabel() to take a struct device * as well,
so that dv_xname can be used for error messages. Furthermore, it'll return
0 on success and -1 on error, which is more mainstream.
Trivial change, really, but I'm soliciting comments on it anyway. I'll
make the change in a few days if noone objects.
- Frank