lkml.org 
[lkml]   [2002]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: O_DIRECT fails in some kernel and FS
On Sat, Feb 02, 2002 at 02:16:41PM -0600, Stephen Lord wrote:
> Can't you fall back to buffered I/O for the tail? OK it complicates the
> code, probably a lot, but it keeps things sane from the user's point of
> view.

For O_DIRECT, IMHO you should fail not fallback. You're simply lying
to the underlying program otherwise.

In the ibu fs I am hacking on, the idea for O_DIRECT is to fail a read
if the file is small enough to fit in the inode. If the O_DIRECT
action is a write, then I will invalidate the data in the inode,
then follow the standard path (which eventually calls get_block()).

For file tails (a different case from small-file-in-inode), I
imagine it would be prudent to support O_DIRECT for all actions
except reading the file tail. If you want to be complicated, you
could provide userspace with a way to say "this is a dense file"
and/or simply not create a tail at all...

Jeff



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

\
 
 \ /
  Last update: 2005-03-22 13:18    [W:0.132 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site