Lines Matching refs:page
43 __nilfs_get_page_block(struct page *page, unsigned long block, pgoff_t index, in __nilfs_get_page_block() argument
50 if (!page_has_buffers(page)) in __nilfs_get_page_block()
51 create_empty_buffers(page, 1 << blkbits, b_state); in __nilfs_get_page_block()
54 bh = nilfs_page_get_nth_block(page, block - first_block); in __nilfs_get_page_block()
68 struct page *page; in nilfs_grab_buffer() local
71 page = grab_cache_page(mapping, index); in nilfs_grab_buffer()
72 if (unlikely(!page)) in nilfs_grab_buffer()
75 bh = __nilfs_get_page_block(page, blkoff, index, blkbits, b_state); in nilfs_grab_buffer()
77 unlock_page(page); in nilfs_grab_buffer()
78 page_cache_release(page); in nilfs_grab_buffer()
91 struct page *page = bh->b_page; in nilfs_forget_buffer() local
98 if (nilfs_page_buffers_clean(page)) in nilfs_forget_buffer()
99 __nilfs_clear_page_dirty(page); in nilfs_forget_buffer()
104 ClearPageUptodate(page); in nilfs_forget_buffer()
105 ClearPageMappedToDisk(page); in nilfs_forget_buffer()
119 struct page *spage = sbh->b_page, *dpage = dbh->b_page; in nilfs_copy_buffer()
156 int nilfs_page_buffers_clean(struct page *page) in nilfs_page_buffers_clean() argument
160 bh = head = page_buffers(page); in nilfs_page_buffers_clean()
169 void nilfs_page_bug(struct page *page) in nilfs_page_bug() argument
174 if (unlikely(!page)) { in nilfs_page_bug()
179 m = page->mapping; in nilfs_page_bug()
184 page, atomic_read(&page->_count), in nilfs_page_bug()
185 (unsigned long long)page->index, page->flags, m, ino); in nilfs_page_bug()
187 if (page_has_buffers(page)) { in nilfs_page_bug()
191 bh = head = page_buffers(page); in nilfs_page_bug()
212 static void nilfs_copy_page(struct page *dst, struct page *src, int copy_dirty) in nilfs_copy_page()
271 struct page *page = pvec.pages[i], *dpage; in nilfs_copy_dirty_pages() local
273 lock_page(page); in nilfs_copy_dirty_pages()
274 if (unlikely(!PageDirty(page))) in nilfs_copy_dirty_pages()
275 NILFS_PAGE_BUG(page, "inconsistent dirty state"); in nilfs_copy_dirty_pages()
277 dpage = grab_cache_page(dmap, page->index); in nilfs_copy_dirty_pages()
281 unlock_page(page); in nilfs_copy_dirty_pages()
284 if (unlikely(!page_has_buffers(page))) in nilfs_copy_dirty_pages()
285 NILFS_PAGE_BUG(page, in nilfs_copy_dirty_pages()
288 nilfs_copy_page(dpage, page, 1); in nilfs_copy_dirty_pages()
293 unlock_page(page); in nilfs_copy_dirty_pages()
327 struct page *page = pvec.pages[i], *dpage; in nilfs_copy_back_pages() local
328 pgoff_t offset = page->index; in nilfs_copy_back_pages()
330 lock_page(page); in nilfs_copy_back_pages()
335 nilfs_copy_page(dpage, page, 0); in nilfs_copy_back_pages()
339 struct page *page2; in nilfs_copy_back_pages()
344 WARN_ON(page2 != page); in nilfs_copy_back_pages()
350 err = radix_tree_insert(&dmap->page_tree, offset, page); in nilfs_copy_back_pages()
353 page->mapping = NULL; in nilfs_copy_back_pages()
354 page_cache_release(page); /* for cache */ in nilfs_copy_back_pages()
356 page->mapping = dmap; in nilfs_copy_back_pages()
358 if (PageDirty(page)) in nilfs_copy_back_pages()
365 unlock_page(page); in nilfs_copy_back_pages()
389 struct page *page = pvec.pages[i]; in nilfs_clear_dirty_pages() local
391 lock_page(page); in nilfs_clear_dirty_pages()
392 nilfs_clear_dirty_page(page, silent); in nilfs_clear_dirty_pages()
393 unlock_page(page); in nilfs_clear_dirty_pages()
405 void nilfs_clear_dirty_page(struct page *page, bool silent) in nilfs_clear_dirty_page() argument
407 struct inode *inode = page->mapping->host; in nilfs_clear_dirty_page()
410 BUG_ON(!PageLocked(page)); in nilfs_clear_dirty_page()
415 page_offset(page), inode->i_ino); in nilfs_clear_dirty_page()
418 ClearPageUptodate(page); in nilfs_clear_dirty_page()
419 ClearPageMappedToDisk(page); in nilfs_clear_dirty_page()
421 if (page_has_buffers(page)) { in nilfs_clear_dirty_page()
424 bh = head = page_buffers(page); in nilfs_clear_dirty_page()
442 __nilfs_clear_page_dirty(page); in nilfs_clear_dirty_page()
445 unsigned nilfs_page_count_clean_buffers(struct page *page, in nilfs_page_count_clean_buffers() argument
452 for (bh = head = page_buffers(page), block_start = 0; in nilfs_page_count_clean_buffers()
484 int __nilfs_clear_page_dirty(struct page *page) in __nilfs_clear_page_dirty() argument
486 struct address_space *mapping = page->mapping; in __nilfs_clear_page_dirty()
490 if (test_bit(PG_dirty, &page->flags)) { in __nilfs_clear_page_dirty()
492 page_index(page), in __nilfs_clear_page_dirty()
495 return clear_page_dirty_for_io(page); in __nilfs_clear_page_dirty()
500 return TestClearPageDirty(page); in __nilfs_clear_page_dirty()
525 struct page *page; in nilfs_find_uncommitted_extent() local
547 page = pvec.pages[i]; in nilfs_find_uncommitted_extent()
549 lock_page(page); in nilfs_find_uncommitted_extent()
550 if (page_has_buffers(page)) { in nilfs_find_uncommitted_extent()
553 bh = head = page_buffers(page); in nilfs_find_uncommitted_extent()
571 unlock_page(page); in nilfs_find_uncommitted_extent()
575 index = page->index + 1; in nilfs_find_uncommitted_extent()
581 unlock_page(page); in nilfs_find_uncommitted_extent()