Subject: Re: Supporting sector size != DEV_BSIZE -- patches
To: None <tech-kern@netbsd.org, trevin@xmission.com>
From: None <eeh@netbsd.org>
List: tech-kern
Date: 06/03/2002 23:51:50
| I've implemented a fix for the ffs filesystem so that all upper-level disk
| operations use DEV_BSIZE blocks, and the actual sector size is left to the
| physical device driver (below the buffer cache).  I've successfully
| created, mounted, and written to a virtual disk using 2048-byte sectors.
| Next thing I need to do is run the patched NetBSD on real hardware (I've
| been using VMware for testing :-) and see if it will work with a SCSI MO
| drive.

I don't think that's a very good way of doing this.  This means you have to
fix every single filesystem to handle different block sizes. 

The BSD FFS should be quite capable of handling blocks of different sizes 
without a problem.  It's just the buffer cache that expects everything 
to be in increments of DEV_BSIZE.

The two ways I would recommend trying to tackle the problem would be
either fix the buffer cache so it can handle different block sizes for
different devices, or enhance the disk driver to do whatever it needs to
so transfers in DEV_BSIZE increments can be converted to native device
block sizes.

Fixing the buffer cache is definitely the better way to go.  But since
DEV_BSIZE is so ubiquitous throughout the kernel, this is no small task.

Chuck Silvers mentioned he wants to address this issue some time.  You
might want to send him some email to see what his thoughts are.

Eduardo