diff options
author | Miquel van Smoorenburg <miquels@cistron.nl> | 2005-01-14 23:20:28 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-01-14 23:20:28 -0800 |
commit | f48d0ebfe4623b082237d414feb3985d7452a3ef (patch) | |
tree | 6a5142de53e2f446d8e3cdd912132a9d4217310e /mm | |
parent | 32616461ba256597ff768d771d449c38ce662043 (diff) | |
download | history-f48d0ebfe4623b082237d414feb3985d7452a3ef.tar.gz |
[PATCH] mark-page-accessed in filemap.c not quite right
I just discovered there's a thinko in the mark-page-accessed change in
do_generic_mapping_read() in 2.6.11-rc1. ra.prev_page is compared to index
to see if we read from this page before - except that prev_page is actually
set to the recent page or even a page in front of the current page.
So we should store ra.prev_page in a seperate variable at the start of
do_generic_mapping_read().
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/filemap.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index 4bfd5aafd90e0e..635b90ca0b6cc8 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -693,6 +693,7 @@ void do_generic_mapping_read(struct address_space *mapping, unsigned long offset; unsigned long req_size; unsigned long next_index; + unsigned long prev_index; loff_t isize; struct page *cached_page; int error; @@ -701,6 +702,7 @@ void do_generic_mapping_read(struct address_space *mapping, cached_page = NULL; index = *ppos >> PAGE_CACHE_SHIFT; next_index = index; + prev_index = ra.prev_page; req_size = (desc->count + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; offset = *ppos & ~PAGE_CACHE_MASK; @@ -754,8 +756,9 @@ page_ok: * When (part of) the same page is read multiple times * in succession, only mark it as accessed the first time. */ - if (ra.prev_page != index) + if (prev_index != index) mark_page_accessed(page); + prev_index = index; /* * Ok, we have the page, and it's up-to-date, so |