Subject: Re: The demise of DEV_BSIZE
To: Bill Studenmund <wrstuden@nas.nasa.gov>
From: Chris G. Demetriou <cgd@netbsd.org>
List: tech-kern
Date: 10/05/1999 15:59:25
Bill Studenmund <wrstuden@nas.nasa.gov> writes:
> Both character and block devices have gained a new function call, d_bsize:
> 
> void    (*d_bsize)      __P((dev_t dev, int * bshift, int * bsize));
> 
> which fills in the bshift and bsize values for a device. bshift == -1
> indicates that the device isn't configured.

If you must add such a function, it would seem to me at least that
returning an error (i.e. having a return value, and using it) if the
device wasn't configured would be better than what you propose
above...  8-)



> disklabel writing needs work in that we shouldn't accept a disklabel which
> we know is not the device's block size. i.e. for sd & cd drives, we can
> querry the device to see what it's block size is. We shouldn't let you set
> a disklabel with a different block size.

I'm not sure i believe this.

It's _nice_ to be able to e.g. take a CD-ROM image and dd it on to a
disk, and try it out.

I think there might be some argument that "disklabel block size must
be pow2 multiple of real block size, and disklabel block size is used
to convert partition offsets into units of 'real' blocks or
something."

But just breaking this is probably the wrong thing to do.



cgd
-- 
Chris Demetriou - cgd@netbsd.org - http://www.netbsd.org/People/Pages/cgd.html
Disclaimer: Not speaking for NetBSD, just expressing my own opinion.