aboutsummaryrefslogtreecommitdiffstats
path: root/mm/filemap.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2007-05-06 17:49:26 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 15:12:52 -0400
commit6ce745ed39d35f9d547d00d406db2be7c6c175b3 (patch)
tree16f471389c9f619c37891fdb6e1843e1f2721c78 /mm/filemap.c
parentec0f16372277052a29a6c17527c6cae5e898b3fd (diff)
readahead: code cleanup
Rename file_ra_state.prev_page to prev_index and file_ra_state.offset to prev_offset. Also update of prev_index in do_generic_mapping_read() is now moved close to the update of prev_offset. [wfg@mail.ustc.edu.cn: fix it] Signed-off-by: Jan Kara <jack@suse.cz> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: WU Fengguang <wfg@mail.ustc.edu.cn> Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/filemap.c')
-rw-r--r--mm/filemap.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 07f5b77114a3..5631d6b2a62d 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -877,8 +877,8 @@ void do_generic_mapping_read(struct address_space *mapping,
877 cached_page = NULL; 877 cached_page = NULL;
878 index = *ppos >> PAGE_CACHE_SHIFT; 878 index = *ppos >> PAGE_CACHE_SHIFT;
879 next_index = index; 879 next_index = index;
880 prev_index = ra.prev_page; 880 prev_index = ra.prev_index;
881 prev_offset = ra.offset; 881 prev_offset = ra.prev_offset;
882 last_index = (*ppos + desc->count + PAGE_CACHE_SIZE-1) >> PAGE_CACHE_SHIFT; 882 last_index = (*ppos + desc->count + PAGE_CACHE_SIZE-1) >> PAGE_CACHE_SHIFT;
883 offset = *ppos & ~PAGE_CACHE_MASK; 883 offset = *ppos & ~PAGE_CACHE_MASK;
884 884
@@ -947,7 +947,8 @@ page_ok:
947 offset += ret; 947 offset += ret;
948 index += offset >> PAGE_CACHE_SHIFT; 948 index += offset >> PAGE_CACHE_SHIFT;
949 offset &= ~PAGE_CACHE_MASK; 949 offset &= ~PAGE_CACHE_MASK;
950 prev_offset = ra.offset = offset; 950 prev_offset = offset;
951 ra.prev_offset = offset;
951 952
952 page_cache_release(page); 953 page_cache_release(page);
953 if (ret == nr && desc->count) 954 if (ret == nr && desc->count)