tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: In-kernel units for block numbers, etc ...



On Fri, Nov 27, 2015 at 05:40:39PM +0000, David Holland wrote:
 > On Thu, Nov 26, 2015 at 11:25:21PM +0000, Michael van Elst wrote:
 >  > dholland-tech%netbsd.org@localhost (David Holland) writes:
 >  > 
 >  > >The problem I see with carrying around unit values at runtime (besides
 >  > >potential overhead) is that at least in FS-level code it'll make a
 >  > >huge mess. FFS, for example, has hardware-level sectors, DEV_BSIZE
 >  > >blocks, fragments, its own blocks, and maybe other things;
 >  > 
 >  > FFS (without WAPBL) has
 >  > 
 >  > - a superblock at a byte offset
 >  > - fragments
 >  > 
 >  > All disk I/O except for the superblock is just accessing
 >  > one or more fragments. Fragment addresses used to be
 >  > converted to physical sector addresses, but in NetBSD
 >  > they are converted to DEV_BSIZE adresses when passed
 >  > to the disk driver. This is done with a single macro.
 >  > 
 >  > It's very simple.
 > 
 > Theoretically, perhaps; in practice, I'm sure that macros like "cgtod"
 > or "dtog" or "lfragtosize" didn't appear with WAPBL.

Also, it's not true. You're forgetting DIRBLKSIZ.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index