summaryrefslogtreecommitdiffstats
path: root/mm/mincore.c
diff options
context:
space:
mode:
authorHugh Dickins <hughd@google.com>2011-08-03 16:21:27 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-08-03 14:25:24 -1000
commit31475dd611209413bace21651a400afb91d0bd9d (patch)
tree679c1cb33e211a4f2e5c0f47bb836393c9454d35 /mm/mincore.c
parent69f07ec938712b58755add82dd3d0b35f01317cc (diff)
mm: a few small updates for radix-swap
Remove PageSwapBacked (!page_is_file_cache) cases from add_to_page_cache_locked() and add_to_page_cache_lru(): those pages now go through shmem_add_to_page_cache(). Remove a comment on maximum tmpfs size from fsstack_copy_inode_size(), and add a comment on swap entries to invalidate_mapping_pages(). And mincore_page() uses find_get_page() on what might be shmem or a tmpfs file: allow for a radix_tree_exceptional_entry(), and proceed to find_get_page() on swapper_space if so (oh, swapper_space needs #ifdef). Signed-off-by: Hugh Dickins <hughd@google.com> Acked-by: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mincore.c')
-rw-r--r--mm/mincore.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/mm/mincore.c b/mm/mincore.c
index a4e6b9d75c7..733f1829b0d 100644
--- a/mm/mincore.c
+++ b/mm/mincore.c
@@ -69,12 +69,14 @@ static unsigned char mincore_page(struct address_space *mapping, pgoff_t pgoff)
* file will not get a swp_entry_t in its pte, but rather it is like
* any other file mapping (ie. marked !present and faulted in with
* tmpfs's .fault). So swapped out tmpfs mappings are tested here.
- *
- * However when tmpfs moves the page from pagecache and into swapcache,
- * it is still in core, but the find_get_page below won't find it.
- * No big deal, but make a note of it.
*/
page = find_get_page(mapping, pgoff);
+#ifdef CONFIG_SWAP
+ if (radix_tree_exceptional_entry(page)) {
+ swp_entry_t swap = radix_to_swp_entry(page);
+ page = find_get_page(&swapper_space, swap.val);
+ }
+#endif
if (page) {
present = PageUptodate(page);
page_cache_release(page);