aboutsummaryrefslogtreecommitdiffstats
path: root/mm/readahead.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2009-04-03 11:42:36 -0400
committerDavid Howells <dhowells@redhat.com>2009-04-03 11:42:36 -0400
commit266cf658efcf6ac33541a46740f74f50c79d2b6b (patch)
tree5c83b0879892d509e598dfd54be3ba3679ecd348 /mm/readahead.c
parent03fb3d2af96c2783c3a5bc03f3d984cf422f0e69 (diff)
FS-Cache: Recruit a page flags for cache management
Recruit a page flag to aid in cache management. The following extra flag is defined: (1) PG_fscache (PG_private_2) The marked page is backed by a local cache and is pinning resources in the cache driver. If PG_fscache is set, then things that checked for PG_private will now also check for that. This includes things like truncation and page invalidation. The function page_has_private() had been added to make the checks for both PG_private and PG_private_2 at the same time. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Steve Dickson <steved@redhat.com> Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com> Acked-by: Rik van Riel <riel@redhat.com> Acked-by: Al Viro <viro@zeniv.linux.org.uk> Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
Diffstat (limited to 'mm/readahead.c')
-rw-r--r--mm/readahead.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mm/readahead.c b/mm/readahead.c
index 6be927569cf6..133b6d525513 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -33,14 +33,15 @@ EXPORT_SYMBOL_GPL(file_ra_state_init);
33 33
34/* 34/*
35 * see if a page needs releasing upon read_cache_pages() failure 35 * see if a page needs releasing upon read_cache_pages() failure
36 * - the caller of read_cache_pages() may have set PG_private before calling, 36 * - the caller of read_cache_pages() may have set PG_private or PG_fscache
37 * such as the NFS fs marking pages that are cached locally on disk, thus we 37 * before calling, such as the NFS fs marking pages that are cached locally
38 * need to give the fs a chance to clean up in the event of an error 38 * on disk, thus we need to give the fs a chance to clean up in the event of
39 * an error
39 */ 40 */
40static void read_cache_pages_invalidate_page(struct address_space *mapping, 41static void read_cache_pages_invalidate_page(struct address_space *mapping,
41 struct page *page) 42 struct page *page)
42{ 43{
43 if (PagePrivate(page)) { 44 if (page_has_private(page)) {
44 if (!trylock_page(page)) 45 if (!trylock_page(page))
45 BUG(); 46 BUG();
46 page->mapping = mapping; 47 page->mapping = mapping;