aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2007-05-06 17:49:25 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 15:12:52 -0400
commitec0f16372277052a29a6c17527c6cae5e898b3fd (patch)
tree35636edac6ed01baf301f3aca96f090caae82c9d /include/linux/fs.h
parentb813e931b4c8235bb42e301096ea97dbdee3e8fe (diff)
readahead: improve heuristic detecting sequential reads
Introduce ra.offset and store in it an offset where the previous read ended. This way we can detect whether reads are really sequential (and thus we should not mark the page as accessed repeatedly) or whether they are random and just happen to be in the same page (and the page should really be marked accessed again). Signed-off-by: Jan Kara <jack@suse.cz> Acked-by: Nick Piggin <nickpiggin@yahoo.com.au> Cc: WU Fengguang <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 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 7c0077f06e24..0949e243b8b9 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -702,6 +702,7 @@ struct file_ra_state {
702 unsigned long ra_pages; /* Maximum readahead window */ 702 unsigned long ra_pages; /* Maximum readahead window */
703 unsigned long mmap_hit; /* Cache hit stat for mmap accesses */ 703 unsigned long mmap_hit; /* Cache hit stat for mmap accesses */
704 unsigned long mmap_miss; /* Cache miss stat for mmap accesses */ 704 unsigned long mmap_miss; /* Cache miss stat for mmap accesses */
705 unsigned int offset; /* Offset where last read() ended in a page */
705}; 706};
706#define RA_FLAG_MISS 0x01 /* a cache miss occured against this file */ 707#define RA_FLAG_MISS 0x01 /* a cache miss occured against this file */
707#define RA_FLAG_INCACHE 0x02 /* file is already in cache */ 708#define RA_FLAG_INCACHE 0x02 /* file is already in cache */