lkml.org 
[lkml]   [2007]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 6/9] readahead: save mmap read-around states in file_ra_state
Change mmap read-around to share the same code style and data structure
with readahead code.

Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn>
---
mm/filemap.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

--- linux-2.6.24-rc4-mm1.orig/mm/filemap.c
+++ linux-2.6.24-rc4-mm1/mm/filemap.c
@@ -1333,13 +1333,15 @@ static void do_sync_mmap_readahead(struc
if (ra->mmap_miss > MMAP_LOTSAMISS)
return;

- ra_pages = max_sane_readahead(file->f_ra.ra_pages);
+ /*
+ * mmap read-around
+ */
+ ra_pages = max_sane_readahead(ra->ra_pages);
if (ra_pages) {
- pgoff_t start = 0;
-
- if (offset > ra_pages / 2)
- start = offset - ra_pages / 2;
- do_page_cache_readahead(mapping, file, start, ra_pages);
+ ra->start = max_t(long, 0, offset - ra_pages / 2);
+ ra->size = ra_pages;
+ ra->async_size = 0;
+ ra_submit(ra, mapping, file);
}
}

--


\
 
 \ /
  Last update: 2007-12-16 13:11    [W:0.060 / U:3.612 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site