diff options
author | David Howells <dhowells@redhat.com> | 2009-04-03 11:42:36 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2009-04-03 11:42:36 -0400 |
commit | 266cf658efcf6ac33541a46740f74f50c79d2b6b (patch) | |
tree | 5c83b0879892d509e598dfd54be3ba3679ecd348 /mm/migrate.c | |
parent | 03fb3d2af96c2783c3a5bc03f3d984cf422f0e69 (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/migrate.c')
-rw-r--r-- | mm/migrate.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/migrate.c b/mm/migrate.c index a9eff3f092f6..068655d8f883 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -250,7 +250,7 @@ out: | |||
250 | * The number of remaining references must be: | 250 | * The number of remaining references must be: |
251 | * 1 for anonymous pages without a mapping | 251 | * 1 for anonymous pages without a mapping |
252 | * 2 for pages with a mapping | 252 | * 2 for pages with a mapping |
253 | * 3 for pages with a mapping and PagePrivate set. | 253 | * 3 for pages with a mapping and PagePrivate/PagePrivate2 set. |
254 | */ | 254 | */ |
255 | static int migrate_page_move_mapping(struct address_space *mapping, | 255 | static int migrate_page_move_mapping(struct address_space *mapping, |
256 | struct page *newpage, struct page *page) | 256 | struct page *newpage, struct page *page) |
@@ -270,7 +270,7 @@ static int migrate_page_move_mapping(struct address_space *mapping, | |||
270 | pslot = radix_tree_lookup_slot(&mapping->page_tree, | 270 | pslot = radix_tree_lookup_slot(&mapping->page_tree, |
271 | page_index(page)); | 271 | page_index(page)); |
272 | 272 | ||
273 | expected_count = 2 + !!PagePrivate(page); | 273 | expected_count = 2 + !!page_has_private(page); |
274 | if (page_count(page) != expected_count || | 274 | if (page_count(page) != expected_count || |
275 | (struct page *)radix_tree_deref_slot(pslot) != page) { | 275 | (struct page *)radix_tree_deref_slot(pslot) != page) { |
276 | spin_unlock_irq(&mapping->tree_lock); | 276 | spin_unlock_irq(&mapping->tree_lock); |
@@ -386,7 +386,7 @@ EXPORT_SYMBOL(fail_migrate_page); | |||
386 | 386 | ||
387 | /* | 387 | /* |
388 | * Common logic to directly migrate a single page suitable for | 388 | * Common logic to directly migrate a single page suitable for |
389 | * pages that do not use PagePrivate. | 389 | * pages that do not use PagePrivate/PagePrivate2. |
390 | * | 390 | * |
391 | * Pages are locked upon entry and exit. | 391 | * Pages are locked upon entry and exit. |
392 | */ | 392 | */ |
@@ -522,7 +522,7 @@ static int fallback_migrate_page(struct address_space *mapping, | |||
522 | * Buffers may be managed in a filesystem specific way. | 522 | * Buffers may be managed in a filesystem specific way. |
523 | * We must have no buffers or drop them. | 523 | * We must have no buffers or drop them. |
524 | */ | 524 | */ |
525 | if (PagePrivate(page) && | 525 | if (page_has_private(page) && |
526 | !try_to_release_page(page, GFP_KERNEL)) | 526 | !try_to_release_page(page, GFP_KERNEL)) |
527 | return -EAGAIN; | 527 | return -EAGAIN; |
528 | 528 | ||
@@ -655,7 +655,7 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private, | |||
655 | * free the metadata, so the page can be freed. | 655 | * free the metadata, so the page can be freed. |
656 | */ | 656 | */ |
657 | if (!page->mapping) { | 657 | if (!page->mapping) { |
658 | if (!PageAnon(page) && PagePrivate(page)) { | 658 | if (!PageAnon(page) && page_has_private(page)) { |
659 | /* | 659 | /* |
660 | * Go direct to try_to_free_buffers() here because | 660 | * Go direct to try_to_free_buffers() here because |
661 | * a) that's what try_to_release_page() would do anyway | 661 | * a) that's what try_to_release_page() would do anyway |