Re: O_DIRECT foolish question

Chris Wedgwood (cw@f00f.org)
Wed, 12 Feb 2003 14:07:27 -0800


On Wed, Feb 12, 2003 at 04:19:24PM -0500, Bruno Diniz de Paula wrote:

> I am trying to use O_DIRECT to read ordinary files and read syscall
> always returns 0, unless when the file size equals the fs block
> size.

Sounds correct.

> Is it true that I can only use O_DIRECT when the size of the file
> written in the inode is a multiple of block size?

You usually can only do O_DIRECT reads/writes in multiples of the
block size (or in some cases multiples of 512-bytes, but I'm not sure
of that code is still about though).

It depends on the filesystem to some extent.

--cw
-
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/