Lines Matching refs:page
85 struct page *page = pvec->pages[i]; in truncate_exceptional_pvec_entries() local
88 if (!radix_tree_exceptional_entry(page)) { in truncate_exceptional_pvec_entries()
89 pvec->pages[j++] = page; in truncate_exceptional_pvec_entries()
101 __clear_shadow_entry(mapping, index, page); in truncate_exceptional_pvec_entries()
154 void do_invalidatepage(struct page *page, unsigned int offset, in do_invalidatepage() argument
157 void (*invalidatepage)(struct page *, unsigned int, unsigned int); in do_invalidatepage()
159 invalidatepage = page->mapping->a_ops->invalidatepage; in do_invalidatepage()
165 (*invalidatepage)(page, offset, length); in do_invalidatepage()
179 truncate_cleanup_page(struct address_space *mapping, struct page *page) in truncate_cleanup_page() argument
181 if (page_mapped(page)) { in truncate_cleanup_page()
182 pgoff_t nr = PageTransHuge(page) ? HPAGE_PMD_NR : 1; in truncate_cleanup_page()
183 unmap_mapping_pages(mapping, page->index, nr, false); in truncate_cleanup_page()
186 if (page_has_private(page)) in truncate_cleanup_page()
187 do_invalidatepage(page, 0, PAGE_SIZE); in truncate_cleanup_page()
194 cancel_dirty_page(page); in truncate_cleanup_page()
195 ClearPageMappedToDisk(page); in truncate_cleanup_page()
207 invalidate_complete_page(struct address_space *mapping, struct page *page) in invalidate_complete_page() argument
211 if (page->mapping != mapping) in invalidate_complete_page()
214 if (page_has_private(page) && !try_to_release_page(page, 0)) in invalidate_complete_page()
217 ret = remove_mapping(mapping, page); in invalidate_complete_page()
222 int truncate_inode_page(struct address_space *mapping, struct page *page) in truncate_inode_page() argument
224 VM_BUG_ON_PAGE(PageTail(page), page); in truncate_inode_page()
226 if (page->mapping != mapping) in truncate_inode_page()
229 truncate_cleanup_page(mapping, page); in truncate_inode_page()
230 delete_from_page_cache(page); in truncate_inode_page()
237 int generic_error_remove_page(struct address_space *mapping, struct page *page) in generic_error_remove_page() argument
247 return truncate_inode_page(mapping, page); in generic_error_remove_page()
257 int invalidate_inode_page(struct page *page) in invalidate_inode_page() argument
259 struct address_space *mapping = page_mapping(page); in invalidate_inode_page()
262 if (PageDirty(page) || PageWriteback(page)) in invalidate_inode_page()
264 if (page_mapped(page)) in invalidate_inode_page()
266 return invalidate_complete_page(mapping, page); in invalidate_inode_page()
343 struct page *page = pvec.pages[i]; in truncate_inode_pages_range() local
350 if (radix_tree_exceptional_entry(page)) in truncate_inode_pages_range()
353 if (!trylock_page(page)) in truncate_inode_pages_range()
355 WARN_ON(page_to_index(page) != index); in truncate_inode_pages_range()
356 if (PageWriteback(page)) { in truncate_inode_pages_range()
357 unlock_page(page); in truncate_inode_pages_range()
360 if (page->mapping != mapping) { in truncate_inode_pages_range()
361 unlock_page(page); in truncate_inode_pages_range()
364 pagevec_add(&locked_pvec, page); in truncate_inode_pages_range()
377 struct page *page = find_lock_page(mapping, start - 1); in truncate_inode_pages_range() local
378 if (page) { in truncate_inode_pages_range()
385 wait_on_page_writeback(page); in truncate_inode_pages_range()
386 zero_user_segment(page, partial_start, top); in truncate_inode_pages_range()
387 cleancache_invalidate_page(mapping, page); in truncate_inode_pages_range()
388 if (page_has_private(page)) in truncate_inode_pages_range()
389 do_invalidatepage(page, partial_start, in truncate_inode_pages_range()
391 unlock_page(page); in truncate_inode_pages_range()
392 put_page(page); in truncate_inode_pages_range()
396 struct page *page = find_lock_page(mapping, end); in truncate_inode_pages_range() local
397 if (page) { in truncate_inode_pages_range()
398 wait_on_page_writeback(page); in truncate_inode_pages_range()
399 zero_user_segment(page, 0, partial_end); in truncate_inode_pages_range()
400 cleancache_invalidate_page(mapping, page); in truncate_inode_pages_range()
401 if (page_has_private(page)) in truncate_inode_pages_range()
402 do_invalidatepage(page, 0, in truncate_inode_pages_range()
404 unlock_page(page); in truncate_inode_pages_range()
405 put_page(page); in truncate_inode_pages_range()
435 struct page *page = pvec.pages[i]; in truncate_inode_pages_range() local
445 if (radix_tree_exceptional_entry(page)) in truncate_inode_pages_range()
448 lock_page(page); in truncate_inode_pages_range()
449 WARN_ON(page_to_index(page) != index); in truncate_inode_pages_range()
450 wait_on_page_writeback(page); in truncate_inode_pages_range()
451 truncate_inode_page(mapping, page); in truncate_inode_pages_range()
452 unlock_page(page); in truncate_inode_pages_range()
557 struct page *page = pvec.pages[i]; in invalidate_mapping_pages() local
564 if (radix_tree_exceptional_entry(page)) { in invalidate_mapping_pages()
566 page); in invalidate_mapping_pages()
570 if (!trylock_page(page)) in invalidate_mapping_pages()
573 WARN_ON(page_to_index(page) != index); in invalidate_mapping_pages()
576 if (PageTransTail(page)) { in invalidate_mapping_pages()
577 unlock_page(page); in invalidate_mapping_pages()
579 } else if (PageTransHuge(page)) { in invalidate_mapping_pages()
588 unlock_page(page); in invalidate_mapping_pages()
593 ret = invalidate_inode_page(page); in invalidate_mapping_pages()
594 unlock_page(page); in invalidate_mapping_pages()
600 deactivate_file_page(page); in invalidate_mapping_pages()
620 invalidate_complete_page2(struct address_space *mapping, struct page *page) in invalidate_complete_page2() argument
624 if (page->mapping != mapping) in invalidate_complete_page2()
627 if (page_has_private(page) && !try_to_release_page(page, GFP_KERNEL)) in invalidate_complete_page2()
631 if (PageDirty(page)) in invalidate_complete_page2()
634 BUG_ON(page_has_private(page)); in invalidate_complete_page2()
635 __delete_from_page_cache(page, NULL); in invalidate_complete_page2()
639 mapping->a_ops->freepage(page); in invalidate_complete_page2()
641 put_page(page); /* pagecache ref */ in invalidate_complete_page2()
648 static int do_launder_page(struct address_space *mapping, struct page *page) in do_launder_page() argument
650 if (!PageDirty(page)) in do_launder_page()
652 if (page->mapping != mapping || mapping->a_ops->launder_page == NULL) in do_launder_page()
654 return mapping->a_ops->launder_page(page); in do_launder_page()
688 struct page *page = pvec.pages[i]; in invalidate_inode_pages2_range() local
695 if (radix_tree_exceptional_entry(page)) { in invalidate_inode_pages2_range()
697 index, page)) in invalidate_inode_pages2_range()
702 lock_page(page); in invalidate_inode_pages2_range()
703 WARN_ON(page_to_index(page) != index); in invalidate_inode_pages2_range()
704 if (page->mapping != mapping) { in invalidate_inode_pages2_range()
705 unlock_page(page); in invalidate_inode_pages2_range()
708 wait_on_page_writeback(page); in invalidate_inode_pages2_range()
709 if (page_mapped(page)) { in invalidate_inode_pages2_range()
725 BUG_ON(page_mapped(page)); in invalidate_inode_pages2_range()
726 ret2 = do_launder_page(mapping, page); in invalidate_inode_pages2_range()
728 if (!invalidate_complete_page2(mapping, page)) in invalidate_inode_pages2_range()
733 unlock_page(page); in invalidate_inode_pages2_range()
853 struct page *page; in pagecache_isize_extended() local
866 page = find_lock_page(inode->i_mapping, index); in pagecache_isize_extended()
868 if (!page) in pagecache_isize_extended()
874 if (page_mkclean(page)) in pagecache_isize_extended()
875 set_page_dirty(page); in pagecache_isize_extended()
876 unlock_page(page); in pagecache_isize_extended()
877 put_page(page); in pagecache_isize_extended()