Re: O_DIRECT alignment requirements ?

From: Rob van Nieuwkerk (robn@verdi.et.tudelft.nl)
Date: Thu Apr 10 2003 - 11:33:54 EST


> On Wed, Apr 09, 2003 at 11:09:23PM +0200, Rob van Nieuwkerk wrote:
> > But a friend of mine uses O_DIRECT with 2.4 kernels to read *individual*
> > single harddisk sectors of 512 bytes ! He claims that my original
> > theory is the right one and that you can read 512 byte chunks on 512
> > byte bounderies (he uses the complete device eg. /dev/hda).
>
> Well, how does your friend access /dev/hda? Is he using raw
> devices?

Hi all,

OK, I checked again with him. It turns out there was some confusion.
He does read in *1024* byte chunks after all (accessing /dev/hdX
directly) ..

But I still need to do 512 byte chunks myself (*).
I understand that this can be done with the the raw device construction ?

Would it also be possible to change the device blocksize with a BLKBSZSET
ioctl() to 512 and do 512 byte transfers after that ?

        greetings,
        Rob van Nieuwkerk

*: you might wonder why I'm so obsessed with 512 transfers ..
   The reason is that I'm working with a USB device (driver) that
   dies when there is too much CompactFlash IDE access (because
   of data-records logged to the CF). I want to have the absolute
   minimum amount of disk-access.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Apr 15 2003 - 22:00:20 EST