Messages in this thread | | | Date | Wed, 21 Jul 2004 02:05:20 +0200 | From | Rob van Nieuwkerk <> | Subject | Re: O_DIRECT |
| |
On Tue, 20 Jul 2004 10:27:57 -0700 Shesha Sreenivasamurthy <shesha@inostor.com> 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.
yes.
> 2. If no file system is created then what should be the softblock size. > I am using the IOCTL "BLKBSZGET". Is this correct?
yes.
> 3. Can we use SEEK_END with O_DIRECT on a partition without filesystem.
yes.
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.
greetings, Rob van Nieuwkerk - 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/
| |