lkml.org 
[lkml]   [2005]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] don't allow sys_readahead() on files opened with O_DIRECT
do_readahead() doesn't make sense if the file is opened with O_DIRECT, 
since only the page cache is stuffed but never used.

Signed-off-by: Jan Blunck <j.blunck@tu-harburg.de>

mm/filemap.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
Index: experimental-um/mm/filemap.c
===================================================================
--- experimental-um.orig/mm/filemap.c
+++ experimental-um/mm/filemap.c
@@ -1110,7 +1110,8 @@ static ssize_t
do_readahead(struct address_space *mapping, struct file *filp,
unsigned long index, unsigned long nr)
{
- if (!mapping || !mapping->a_ops || !mapping->a_ops->readpage)
+ if (!mapping || !mapping->a_ops || !mapping->a_ops->readpage
+ || mapping->a_ops->direct_IO)
return -EINVAL;

force_page_cache_readahead(mapping, filp, index,
\
 
 \ /
  Last update: 2005-06-06 13:43    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site