Subject: Re: dictating buffersizes passed in vop_strategy
To: None <tech-kern@netbsd.org>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 09/02/2005 08:43:29
On Fri, Sep 02, 2005 at 04:14:46PM +0200, Reinoud Zandijk wrote:
> Dear folks,
> 
> is there a posibility for a filingsystem to dictate the buffer sizes passed 
> to the vop_strategy() vfs op or a minimum size by adjusting parameters in 
> the vop_read/vop_write interface to UBC? A small scout on msdosfs shows 
> various buffer sizes ranging from say 8kb to 64kb are passed though allways 
> a power of 2.
> 
> For UDF the most common sector size is 2kb so all buffers seen passed are 
> multiples of 2kb since all powers of 2 are thus also devidable so problems 
> are less likely to occure in real-life though i wonder if a buffer of say 
> 512 bytes can be passed wich would force a RMW cycle.

the strategy interface allows specifying any size in bytes, though the offset
is in units of DEV_BSIZE, so it doesn't make much sense to use sizes that
are not multiples of DEV_BSIZE as well.

but it's the responsibility of the file system to avoid issuing I/O requests
that are not a multiple of the sector size of the underlying device,
even if that sector size is larger than DEV_BSIZE.  it's fine for a
device driver to reject requests that are not a multiple of the device's
sector size, that's what all the existing drivers do (except for a hack
in the SCSI CD driver, for handling UFS images).

-Chuck