diff options
| author | Andrew Morton <akpm@digeo.com> | 2003-06-28 00:09:38 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-06-28 00:09:38 -0700 |
| commit | cb33cf00533bb645ba9a0d5155c1760aa4640723 (patch) | |
| tree | bf61e5160e77af0b3c9f51762513c69048e2689a | |
| parent | b068fc92600faa9f95aa681fe0db4506a03fa22e (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.c | 3 |
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; |
