Subject: Re: CVS commit: src/sys/sys
To: Jason Thorpe <email@example.com>
From: David Laight <firstname.lastname@example.org>
Date: 11/14/2003 15:26:31
> > I think what you want to do exactly is
> > "including declarations of struct disklabel and struct pattitions
> > without including <machine/disklabel.h>", right?
> > Then using MAXPARTITIONS or _MACHINE_DISKLABEL_H_ is
> > not correct even if it works for now.
> > It's still better to add declarations into sys/bootblock.h
> > to define info about target machines.
> Agreed. Or add it to sys/disklabel.h prefaced with the machine name:
> #define MAXPARTITIONS_HP300 8
> and then in <machine/disklabel.h> for hp300:
> #define MAXPARTITIONS MAXPARTITIONS_HP300
> This would even allow us to move forward on a disklabel library that
> understood the disklabel formats/offsets used by our various platforms.
In this case the code doesn't care about the value of MAXPARTITIONS.
It looks at label.d_npartitions ( validating against MAXMAXPARTITIONS).
All it wants is 'struct disklabel', doesn't care about the size.
I certainly agree that a disklabel library would be useful.
One reason I wanted to rip out the installboot stuff from disklabel
was to give a chance of restructuring the rest of the code a little.
The way it handles boot code makes it all too hard otherwise.
David Laight: email@example.com