path: root/mm/mincore.c
diff options
authorHugh Dickins <>2011-08-03 23:21:27 (GMT)
committerLinus Torvalds <>2011-08-04 00:25:24 (GMT)
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 <> Acked-by: Rik van Riel <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'mm/mincore.c')
1 files changed, 6 insertions, 4 deletions
diff --git a/mm/mincore.c b/mm/mincore.c
index a4e6b9d..733f182 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);
+ if (radix_tree_exceptional_entry(page)) {
+ swp_entry_t swap = radix_to_swp_entry(page);
+ page = find_get_page(&swapper_space, swap.val);
+ }
if (page) {
present = PageUptodate(page);