aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pagemap.h
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2007-05-06 17:49:04 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 15:12:51 -0400
commit6fe6900e1e5b6fa9e5c59aa5061f244fe3f467e2 (patch)
tree8bbfe5072279227cc50a941ad4813908082426a1 /include/linux/pagemap.h
parent714b8171af9c930a59a0da8f6fe50518e70ab035 (diff)
mm: make read_cache_page synchronous
Ensure pages are uptodate after returning from read_cache_page, which allows us to cut out most of the filesystem-internal PageUptodate calls. I didn't have a great look down the call chains, but this appears to fixes 7 possible use-before uptodate in hfs, 2 in hfsplus, 1 in jfs, a few in ecryptfs, 1 in jffs2, and a possible cleared data overwritten with readpage in block2mtd. All depending on whether the filler is async and/or can return with a !uptodate page. Signed-off-by: Nick Piggin <npiggin@suse.de> Cc: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/pagemap.h')
-rw-r--r--include/linux/pagemap.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 7a8dcb82a699..b4def5e083ed 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -95,12 +95,23 @@ static inline struct page *grab_cache_page(struct address_space *mapping, unsign
95 95
96extern struct page * grab_cache_page_nowait(struct address_space *mapping, 96extern struct page * grab_cache_page_nowait(struct address_space *mapping,
97 unsigned long index); 97 unsigned long index);
98extern struct page * read_cache_page_async(struct address_space *mapping,
99 unsigned long index, filler_t *filler,
100 void *data);
98extern struct page * read_cache_page(struct address_space *mapping, 101extern struct page * read_cache_page(struct address_space *mapping,
99 unsigned long index, filler_t *filler, 102 unsigned long index, filler_t *filler,
100 void *data); 103 void *data);
101extern int read_cache_pages(struct address_space *mapping, 104extern int read_cache_pages(struct address_space *mapping,
102 struct list_head *pages, filler_t *filler, void *data); 105 struct list_head *pages, filler_t *filler, void *data);
103 106
107static inline struct page *read_mapping_page_async(
108 struct address_space *mapping,
109 unsigned long index, void *data)
110{
111 filler_t *filler = (filler_t *)mapping->a_ops->readpage;
112 return read_cache_page_async(mapping, index, filler, data);
113}
114
104static inline struct page *read_mapping_page(struct address_space *mapping, 115static inline struct page *read_mapping_page(struct address_space *mapping,
105 unsigned long index, void *data) 116 unsigned long index, void *data)
106{ 117{