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
99 if (nilfs_page_buffers_clean(page)) in nilfs_forget_buffer()
100 __nilfs_clear_page_dirty(page); in nilfs_forget_buffer()
103 ClearPageUptodate(page); in nilfs_forget_buffer()
104 ClearPageMappedToDisk(page); in nilfs_forget_buffer()
118 struct page *spage = sbh->b_page, *dpage = dbh->b_page; in nilfs_copy_buffer()
155 int nilfs_page_buffers_clean(struct page *page) in nilfs_page_buffers_clean() argument
159 bh = head = page_buffers(page); in nilfs_page_buffers_clean()
168 void nilfs_page_bug(struct page *page) in nilfs_page_bug() argument
173 if (unlikely(!page)) { in nilfs_page_bug()
178 m = page->mapping; in nilfs_page_bug()
183 page, atomic_read(&page->_count), in nilfs_page_bug()
184 (unsigned long long)page->index, page->flags, m, ino); in nilfs_page_bug()
186 if (page_has_buffers(page)) { in nilfs_page_bug()
190 bh = head = page_buffers(page); in nilfs_page_bug()
211 static void nilfs_copy_page(struct page *dst, struct page *src, int copy_dirty) in nilfs_copy_page()
270 struct page *page = pvec.pages[i], *dpage; in nilfs_copy_dirty_pages() local
272 lock_page(page); in nilfs_copy_dirty_pages()
273 if (unlikely(!PageDirty(page))) in nilfs_copy_dirty_pages()
274 NILFS_PAGE_BUG(page, "inconsistent dirty state"); in nilfs_copy_dirty_pages()
276 dpage = grab_cache_page(dmap, page->index); in nilfs_copy_dirty_pages()
280 unlock_page(page); in nilfs_copy_dirty_pages()
283 if (unlikely(!page_has_buffers(page))) in nilfs_copy_dirty_pages()
284 NILFS_PAGE_BUG(page, in nilfs_copy_dirty_pages()
287 nilfs_copy_page(dpage, page, 1); in nilfs_copy_dirty_pages()
292 unlock_page(page); in nilfs_copy_dirty_pages()
326 struct page *page = pvec.pages[i], *dpage; in nilfs_copy_back_pages() local
327 pgoff_t offset = page->index; in nilfs_copy_back_pages()
329 lock_page(page); in nilfs_copy_back_pages()
334 nilfs_copy_page(dpage, page, 0); in nilfs_copy_back_pages()
338 struct page *page2; in nilfs_copy_back_pages()
343 WARN_ON(page2 != page); in nilfs_copy_back_pages()
349 err = radix_tree_insert(&dmap->page_tree, offset, page); in nilfs_copy_back_pages()
352 page->mapping = NULL; in nilfs_copy_back_pages()
353 page_cache_release(page); /* for cache */ in nilfs_copy_back_pages()
355 page->mapping = dmap; in nilfs_copy_back_pages()
357 if (PageDirty(page)) in nilfs_copy_back_pages()
364 unlock_page(page); in nilfs_copy_back_pages()
388 struct page *page = pvec.pages[i]; in nilfs_clear_dirty_pages() local
390 lock_page(page); in nilfs_clear_dirty_pages()
391 nilfs_clear_dirty_page(page, silent); in nilfs_clear_dirty_pages()
392 unlock_page(page); in nilfs_clear_dirty_pages()
404 void nilfs_clear_dirty_page(struct page *page, bool silent) in nilfs_clear_dirty_page() argument
406 struct inode *inode = page->mapping->host; in nilfs_clear_dirty_page()
409 BUG_ON(!PageLocked(page)); in nilfs_clear_dirty_page()
414 page_offset(page), inode->i_ino); in nilfs_clear_dirty_page()
417 ClearPageUptodate(page); in nilfs_clear_dirty_page()
418 ClearPageMappedToDisk(page); in nilfs_clear_dirty_page()
420 if (page_has_buffers(page)) { in nilfs_clear_dirty_page()
427 bh = head = page_buffers(page); in nilfs_clear_dirty_page()
440 __nilfs_clear_page_dirty(page); in nilfs_clear_dirty_page()
443 unsigned nilfs_page_count_clean_buffers(struct page *page, in nilfs_page_count_clean_buffers() argument
450 for (bh = head = page_buffers(page), block_start = 0; in nilfs_page_count_clean_buffers()
480 int __nilfs_clear_page_dirty(struct page *page) in __nilfs_clear_page_dirty() argument
482 struct address_space *mapping = page->mapping; in __nilfs_clear_page_dirty()
486 if (test_bit(PG_dirty, &page->flags)) { in __nilfs_clear_page_dirty()
488 page_index(page), in __nilfs_clear_page_dirty()
491 return clear_page_dirty_for_io(page); in __nilfs_clear_page_dirty()
496 return TestClearPageDirty(page); in __nilfs_clear_page_dirty()
521 struct page *page; in nilfs_find_uncommitted_extent() local
543 page = pvec.pages[i]; in nilfs_find_uncommitted_extent()
545 lock_page(page); in nilfs_find_uncommitted_extent()
546 if (page_has_buffers(page)) { in nilfs_find_uncommitted_extent()
549 bh = head = page_buffers(page); in nilfs_find_uncommitted_extent()
567 unlock_page(page); in nilfs_find_uncommitted_extent()
571 index = page->index + 1; in nilfs_find_uncommitted_extent()
577 unlock_page(page); in nilfs_find_uncommitted_extent()