Lines Matching refs:page
80 /* We don't use the page cache to create symlink data, so if
221 int ocfs2_read_inline_data(struct inode *inode, struct page *page,
245 kaddr = kmap_atomic(page);
248 /* Clear the remaining part of the page */
250 flush_dcache_page(page);
253 SetPageUptodate(page);
258 static int ocfs2_readpage_inline(struct inode *inode, struct page *page)
263 BUG_ON(!PageLocked(page));
272 ret = ocfs2_read_inline_data(inode, page, di_bh);
274 unlock_page(page);
280 static int ocfs2_readpage(struct file *file, struct page *page)
282 struct inode *inode = page->mapping->host;
284 loff_t start = (loff_t)page->index << PAGE_SHIFT;
288 (page ? page->index : 0));
290 ret = ocfs2_inode_lock_with_page(inode, NULL, 0, page);
300 * Unlock the page and cycle ip_alloc_sem so that we don't
304 unlock_page(page);
317 * and notice that the page they just read isn't needed.
322 zero_user(page, 0, PAGE_SIZE);
323 SetPageUptodate(page);
329 ret = ocfs2_readpage_inline(inode, page);
331 ret = block_read_full_page(page, ocfs2_get_block);
340 unlock_page(page);
360 * Use the nonblocking flag for the dlm code to avoid page
397 * ->writepage is called during the process of invalidating the page cache
403 static int ocfs2_writepage(struct page *page, struct writeback_control *wbc)
406 (unsigned long long)OCFS2_I(page->mapping->host)->ip_blkno,
407 page->index);
409 return block_write_full_page(page, ocfs2_get_block, wbc);
502 static int ocfs2_releasepage(struct page *page, gfp_t wait)
504 if (!page_has_buffers(page))
506 return try_to_free_buffers(page);
537 * 'from' and 'to' are the region in the page to avoid zeroing.
544 static void ocfs2_clear_page_regions(struct page *page,
553 kaddr = kmap_atomic(page);
574 static int ocfs2_should_read_blk(struct inode *inode, struct page *page,
577 u64 offset = page_offset(page) + block_start;
595 int ocfs2_map_page_blocks(struct page *page, u64 *p_blkno,
604 if (!page_has_buffers(page))
605 create_empty_buffers(page, bsize, 0);
607 head = page_buffers(page);
619 if (PageUptodate(page))
625 * For an allocating write with cluster size >= page
626 * size, we always write the entire page.
636 if (PageUptodate(page)) {
641 ocfs2_should_read_blk(inode, page, block_start) &&
675 zero_user(page, block_start, bh->b_size);
741 * w_target_page is the page being written to by the user.
751 struct page *w_pages[OCFS2_MAX_CTXT_PAGES];
752 struct page *w_target_page;
781 void ocfs2_unlock_and_free_pages(struct page **pages, int num_pages)
800 * The intent is to allow us to lock the target page from write_begin()
875 * If a page has any new buffers, zero them out here, and mark them uptodate
879 static void ocfs2_zero_new_buffers(struct page *page, unsigned from, unsigned to)
884 BUG_ON(!PageLocked(page));
885 if (!page_has_buffers(page))
888 bh = head = page_buffers(page);
895 if (!PageUptodate(page)) {
901 zero_user_segment(page, start, end);
926 struct page *tmppage;
946 struct page *page, u32 cpos,
959 * the page boundary.
961 new = new | ((i_size_read(inode) <= page_offset(page)) &&
962 (page_offset(page) <= user_pos));
964 if (page == wc->w_target_page) {
969 ret = ocfs2_map_page_blocks(page, p_blkno, inode,
973 ret = ocfs2_map_page_blocks(page, p_blkno, inode,
988 * If we haven't allocated the new page yet, we
997 ret = ocfs2_map_page_blocks(page, p_blkno, inode,
1010 * range inside of a page needs to be written.
1012 * We can skip this if the page is up to date - it's already
1015 if (new && !PageUptodate(page))
1016 ocfs2_clear_page_regions(page, OCFS2_SB(inode->i_sb),
1019 flush_dcache_page(page);
1032 struct page *mmap_page)
1044 * page. Otherwise, we'll need a whole clusters worth. If we're
1046 * last page of the write.
1052 * We need the index *past* the last page we could possibly
1053 * touch. This is the page past the end of the write or
1074 * and wants us to directly use the page
1092 /* Direct write has no mapping page. */
1137 * This is safe to call with the page locks - it won't take
1194 /* This is the direct io target page. */
1267 * ocfs2_write_end() wants to know which parts of the target page it
1285 * on page size and cluster size.
1482 struct page *page;
1493 page = find_or_create_page(mapping, 0, GFP_NOFS);
1494 if (!page) {
1501 * If we don't set w_num_pages then this page won't get unlocked
1504 wc->w_pages[0] = wc->w_target_page = page;
1519 if (!PageUptodate(page)) {
1520 ret = ocfs2_read_inline_data(inode, page, wc->w_di_bh);
1544 unsigned len, struct page *mmap_page,
1652 struct page **pagep, void **fsdata,
1653 struct buffer_head *di_bh, struct page *mmap_page)
1733 * ocfs2_write_end() knows which range in the target page to
1799 * Fill our page array first. That way we've grabbed enough so
1812 * the target page. In this case, we exit with no error and no target
1813 * page. This will trigger the caller, page_mkwrite(), to re-try
1848 * The mmapped page won't be unlocked in ocfs2_free_write_ctxt(),
1850 * to unlock the target page manually to prevent deadlocks when
1888 struct page **pagep, void **fsdata)
1964 struct page *tmppage;
1995 * When page is fully beyond new isize (data copy
1996 * failed), do not bother zeroing the page. Invalidate
1998 * put page & buffer dirty bits into inconsistent
2010 /* This is the direct io target page. */
2066 * this lock and will ask for the page lock when flushing the data.
2084 struct page *page, void *fsdata)