Lines Matching defs:page

24 int reiserfs_commit_write(struct file *f, struct page *page,
169 * about what happens for reading a file. For each page,
185 * If this page has a file tail in it, and
186 * it was read in by get_block_create_0, the page data is valid,
188 * it. So, look through this page, and check all the mapped buffers
193 static inline void fix_tail_page_for_writing(struct page *page)
197 if (page && page_has_buffers(page)) {
198 head = page_buffers(page);
281 * of page (bh_result)
311 * We do not return -ENOENT if there is a hole but page is
343 * page is uptodate, because it means that there is
366 * if we've got a direct item, and the buffer or page was uptodate,
375 * up to date pages without any buffers. If the page is up
383 /* read file tail into part of page */
388 * we only want to kmap if we are reading the tail into the page.
486 * in a page. Where it does not produce a valid page for holes, or past the
575 struct page *tail_page;
576 struct page *hole_page = bh_result->b_page;
589 * that we cannot get here if we write with O_DIRECT into tail page
603 * we were locking the page because anyone that could convert
606 * We must fix the tail page for writing because it might have buffers
608 * data that has been read directly into the page, and
617 /* tail conversion might change the data in the page */
902 * also get into page cache
989 * but it sets the page dirty too, which makes
2157 * finds the tail page in the page cache,
2160 * On success, page_result is set to a locked, pinned page, and bh_result
2170 struct page **page_result,
2175 * we want the page with the last byte in the file,
2176 * not the page that will hold the next byte for appending
2185 struct page *page;
2197 page = grab_cache_page(inode->i_mapping, index);
2199 if (!page) {
2202 /* start within the page of the last block in the file */
2205 error = __block_write_begin(page, start, offset - start,
2210 head = page_buffers(page);
2233 *page_result = page;
2239 unlock_page(page);
2240 put_page(page);
2257 struct page *page = NULL;
2265 error = grab_tail_page(inode, &page, &bh);
2276 page = NULL;
2282 * so, if page != NULL, we have a buffer head for the offset at
2306 err2 = reiserfs_do_truncate(&th, inode, page, update_timestamps);
2323 if (page) {
2328 zero_user(page, offset, length);
2333 unlock_page(page);
2334 put_page(page);
2341 if (page) {
2342 unlock_page(page);
2343 put_page(page);
2495 * we've copied data from the page into the direct item, so the
2496 * buffer in the page is now clean, mark it to reflect that.
2510 static int reiserfs_write_full_page(struct page *page,
2513 struct inode *inode = page->mapping->host;
2521 int checked = PageChecked(page);
2529 redirty_page_for_writepage(wbc, page);
2530 unlock_page(page);
2535 * The page dirty bit is cleared before writepage is called, which
2537 * The page really should be up to date at this point, so tossing
2540 if (!page_has_buffers(page)) {
2541 create_empty_buffers(page, s->s_blocksize,
2544 head = page_buffers(page);
2547 * last page in the file, zero out any contents past the
2550 if (page->index >= end_index) {
2554 /* no file contents in this page */
2555 if (page->index >= end_index + 1 || !last_offset) {
2556 unlock_page(page);
2559 zero_user_segment(page, last_offset, PAGE_SIZE);
2562 block = page->index << (PAGE_SHIFT - s->s_blocksize_bits);
2569 * the page size. The corresponding bytes in the page
2596 ClearPageChecked(page);
2605 /* now go through and lock any dirty buffers on the page */
2626 redirty_page_for_writepage(wbc, page);
2643 BUG_ON(PageWriteback(page));
2644 set_page_writeback(page);
2645 unlock_page(page);
2648 * since any buffer might be the only dirty buffer on the page,
2649 * the first submit_bh can bring the page out of writeback.
2666 * if this page only had a direct item, it is very possible for
2669 * pipe without locking the page
2680 SetPageUptodate(page);
2681 end_page_writeback(page);
2688 * get to the media. The page is currently locked and not marked for
2691 ClearPageUptodate(page);
2701 * getting attached to a dirty page
2707 SetPageError(page);
2708 BUG_ON(PageWriteback(page));
2709 set_page_writeback(page);
2710 unlock_page(page);
2729 static int reiserfs_writepage(struct page *page, struct writeback_control *wbc)
2731 struct inode *inode = page->mapping->host;
2733 return reiserfs_write_full_page(page, wbc);
2745 struct page **pagep, void **fsdata)
2748 struct page *page;
2755 page = grab_cache_page_write_begin(mapping, index);
2756 if (!page)
2758 *pagep = page;
2761 fix_tail_page_for_writing(page);
2771 ret = __block_write_begin(page, pos, len, reiserfs_get_block);
2801 unlock_page(page);
2802 put_page(page);
2809 int __reiserfs_write_begin(struct page *page, unsigned from, unsigned len)
2811 struct inode *inode = page->mapping->host;
2820 fix_tail_page_for_writing(page);
2831 ret = __block_write_begin(page, from, len, reiserfs_get_block);
2871 struct page *page, void *fsdata)
2873 struct folio *folio = page_folio(page);
2874 struct inode *inode = page->mapping->host;
2896 reiserfs_commit_page(inode, page, start, start + copied);
2951 unlock_page(page);
2952 put_page(page);
2970 int reiserfs_commit_write(struct file *f, struct page *page,
2973 struct inode *inode = page->mapping->host;
2974 loff_t pos = ((loff_t) page->index << PAGE_SHIFT) + to;
2987 reiserfs_commit_page(inode, page, from, to);
3087 * the page is locked, and the only places that log a data buffer
3088 * also lock the page.
3171 * We release buffers only if the entire page is being invalidated.