diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-04-07 18:37:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-07 19:35:58 -0400 |
commit | 29f175d125f0f3a9503af8a5596f93d714cceb08 (patch) | |
tree | 442694afa182a6da0549ad00942047482df6bd7f /mm/readahead.c | |
parent | 55f67141a8927b2be3e51840da37b8a2320143ed (diff) |
mm/readahead.c: inline ra_submit
Commit f9acc8c7b35a ("readahead: sanify file_ra_state names") left
ra_submit with a single function call.
Move ra_submit to internal.h and inline it to save some stack. Thanks
to Andrew Morton for commenting different versions.
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/readahead.c')
-rw-r--r-- | mm/readahead.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/mm/readahead.c b/mm/readahead.c index 29c5e1af5a0c..0ca36a7770b1 100644 --- a/mm/readahead.c +++ b/mm/readahead.c | |||
@@ -8,9 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
11 | #include <linux/fs.h> | ||
12 | #include <linux/gfp.h> | 11 | #include <linux/gfp.h> |
13 | #include <linux/mm.h> | ||
14 | #include <linux/export.h> | 12 | #include <linux/export.h> |
15 | #include <linux/blkdev.h> | 13 | #include <linux/blkdev.h> |
16 | #include <linux/backing-dev.h> | 14 | #include <linux/backing-dev.h> |
@@ -20,6 +18,8 @@ | |||
20 | #include <linux/syscalls.h> | 18 | #include <linux/syscalls.h> |
21 | #include <linux/file.h> | 19 | #include <linux/file.h> |
22 | 20 | ||
21 | #include "internal.h" | ||
22 | |||
23 | /* | 23 | /* |
24 | * Initialise a struct file's readahead state. Assumes that the caller has | 24 | * Initialise a struct file's readahead state. Assumes that the caller has |
25 | * memset *ra to zero. | 25 | * memset *ra to zero. |
@@ -149,8 +149,7 @@ out: | |||
149 | * | 149 | * |
150 | * Returns the number of pages requested, or the maximum amount of I/O allowed. | 150 | * Returns the number of pages requested, or the maximum amount of I/O allowed. |
151 | */ | 151 | */ |
152 | static int | 152 | int __do_page_cache_readahead(struct address_space *mapping, struct file *filp, |
153 | __do_page_cache_readahead(struct address_space *mapping, struct file *filp, | ||
154 | pgoff_t offset, unsigned long nr_to_read, | 153 | pgoff_t offset, unsigned long nr_to_read, |
155 | unsigned long lookahead_size) | 154 | unsigned long lookahead_size) |
156 | { | 155 | { |
@@ -244,20 +243,6 @@ unsigned long max_sane_readahead(unsigned long nr) | |||
244 | } | 243 | } |
245 | 244 | ||
246 | /* | 245 | /* |
247 | * Submit IO for the read-ahead request in file_ra_state. | ||
248 | */ | ||
249 | unsigned long ra_submit(struct file_ra_state *ra, | ||
250 | struct address_space *mapping, struct file *filp) | ||
251 | { | ||
252 | int actual; | ||
253 | |||
254 | actual = __do_page_cache_readahead(mapping, filp, | ||
255 | ra->start, ra->size, ra->async_size); | ||
256 | |||
257 | return actual; | ||
258 | } | ||
259 | |||
260 | /* | ||
261 | * Set the initial window size, round to next power of 2 and square | 246 | * Set the initial window size, round to next power of 2 and square |
262 | * for small size, x 4 for medium, and x 2 for large | 247 | * for small size, x 4 for medium, and x 2 for large |
263 | * for 128k (32 page) max ra | 248 | * for 128k (32 page) max ra |