summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morton <akpm@digeo.com>2003-06-28 00:09:38 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-06-28 00:09:38 -0700
commitcb33cf00533bb645ba9a0d5155c1760aa4640723 (patch)
treebf61e5160e77af0b3c9f51762513c69048e2689a
parentb068fc92600faa9f95aa681fe0db4506a03fa22e (diff)
[PATCH] check for presence of readpage() in the readahead code
Make sure that the address_space is capable of performing the readahead before going in and allocating the pages.
-rw-r--r--mm/readahead.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/readahead.c b/mm/readahead.c
index 0ba5344553ea..d6fef1a3c124 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -260,6 +260,9 @@ int do_page_cache_readahead(struct address_space *mapping, struct file *filp,
{
int ret = 0;
+ if (unlikely(!mapping->a_ops->readpage && !mapping->a_ops->readpages))
+ return -EINVAL;
+
while (nr_to_read) {
int err;