From: Jan Blunck <j.blunck@tu-harburg.de>
To: Andrew Morton <akpm@osdl.org>
Cc: Linux-Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] don't allow sys_readahead() on files opened with O_DIRECT
Date: Mon, 06 Jun 2005 13:39:10 +0200 [thread overview]
Message-ID: <42A435DE.50302@tu-harburg.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: filemap.c_direct_IO_readahead.diff --]
[-- Type: text/x-patch, Size: 813 bytes --]
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,
next reply other threads:[~2005-06-06 11:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-06 11:39 Jan Blunck [this message]
2005-06-06 11:43 ` Christoph Hellwig
2005-06-06 12:44 ` Jan Blunck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42A435DE.50302@tu-harburg.de \
--to=j.blunck@tu-harburg.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®