[lkml]   [2004]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: O_DIRECT
On Tue, 20 Jul 2004 10:27:57 -0700
Shesha Sreenivasamurthy <> wrote:

Hi Shesha,

> I am having trouble with O_DIRECT. Trying to read or write from a block
> device partition.
> 1. Can O_DIRECT be used on a plain block device partition say
> "/dev/sda11" without having a filesystem on it.


> 2. If no file system is created then what should be the softblock size.
> I am using the IOCTL "BLKBSZGET". Is this correct?


> 3. Can we use SEEK_END with O_DIRECT on a partition without filesystem.


I'm using these exact things in an application.

Note that with 2.4 kernels the "granularity" you can use for offset
and r/w size is the softblock size (*). For 2.6 the requirements are
much more relaxed: it's the device blocksize (typically 512 byte).

(*): actually one of offset or r/w size has a smaller minimum if
I remember correctly. Don't remember which one. But if you assume
the softblock size as a minimum for both you're allways safe.

Rob van Nieuwkerk
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:04    [W:0.084 / U:2.608 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site