• Home
  • Raw
  • Download

Lines Matching refs:page

40 static void gfs2_page_add_databufs(struct gfs2_inode *ip, struct page *page,  in gfs2_page_add_databufs()  argument
43 struct buffer_head *head = page_buffers(page); in gfs2_page_add_databufs()
96 static int gfs2_writepage_common(struct page *page, in gfs2_writepage_common() argument
99 struct inode *inode = page->mapping->host; in gfs2_writepage_common()
112 if (page->index > end_index || (page->index == end_index && !offset)) { in gfs2_writepage_common()
113 page->mapping->a_ops->invalidatepage(page, 0, PAGE_CACHE_SIZE); in gfs2_writepage_common()
118 redirty_page_for_writepage(wbc, page); in gfs2_writepage_common()
120 unlock_page(page); in gfs2_writepage_common()
131 static int gfs2_writeback_writepage(struct page *page, in gfs2_writeback_writepage() argument
136 ret = gfs2_writepage_common(page, wbc); in gfs2_writeback_writepage()
140 return nobh_writepage(page, gfs2_get_block_noalloc, wbc); in gfs2_writeback_writepage()
150 static int gfs2_ordered_writepage(struct page *page, in gfs2_ordered_writepage() argument
153 struct inode *inode = page->mapping->host; in gfs2_ordered_writepage()
157 ret = gfs2_writepage_common(page, wbc); in gfs2_ordered_writepage()
161 if (!page_has_buffers(page)) { in gfs2_ordered_writepage()
162 create_empty_buffers(page, inode->i_sb->s_blocksize, in gfs2_ordered_writepage()
165 gfs2_page_add_databufs(ip, page, 0, inode->i_sb->s_blocksize-1); in gfs2_ordered_writepage()
166 return block_write_full_page(page, gfs2_get_block_noalloc, wbc); in gfs2_ordered_writepage()
180 static int __gfs2_jdata_writepage(struct page *page, struct writeback_control *wbc) in __gfs2_jdata_writepage() argument
182 struct inode *inode = page->mapping->host; in __gfs2_jdata_writepage()
186 if (PageChecked(page)) { in __gfs2_jdata_writepage()
187 ClearPageChecked(page); in __gfs2_jdata_writepage()
188 if (!page_has_buffers(page)) { in __gfs2_jdata_writepage()
189 create_empty_buffers(page, inode->i_sb->s_blocksize, in __gfs2_jdata_writepage()
192 gfs2_page_add_databufs(ip, page, 0, sdp->sd_vfs->s_blocksize-1); in __gfs2_jdata_writepage()
194 return block_write_full_page(page, gfs2_get_block_noalloc, wbc); in __gfs2_jdata_writepage()
205 static int gfs2_jdata_writepage(struct page *page, struct writeback_control *wbc) in gfs2_jdata_writepage() argument
207 struct inode *inode = page->mapping->host; in gfs2_jdata_writepage()
212 if (PageChecked(page)) { in gfs2_jdata_writepage()
220 ret = gfs2_writepage_common(page, wbc); in gfs2_jdata_writepage()
222 ret = __gfs2_jdata_writepage(page, wbc); in gfs2_jdata_writepage()
228 redirty_page_for_writepage(wbc, page); in gfs2_jdata_writepage()
229 unlock_page(page); in gfs2_jdata_writepage()
276 struct page *page = pvec->pages[i]; in gfs2_write_jdata_pagevec() local
278 lock_page(page); in gfs2_write_jdata_pagevec()
280 if (unlikely(page->mapping != mapping)) { in gfs2_write_jdata_pagevec()
281 unlock_page(page); in gfs2_write_jdata_pagevec()
285 if (!wbc->range_cyclic && page->index > end) { in gfs2_write_jdata_pagevec()
287 unlock_page(page); in gfs2_write_jdata_pagevec()
292 wait_on_page_writeback(page); in gfs2_write_jdata_pagevec()
294 if (PageWriteback(page) || in gfs2_write_jdata_pagevec()
295 !clear_page_dirty_for_io(page)) { in gfs2_write_jdata_pagevec()
296 unlock_page(page); in gfs2_write_jdata_pagevec()
301 if (page->index > end_index || (page->index == end_index && !offset)) { in gfs2_write_jdata_pagevec()
302 page->mapping->a_ops->invalidatepage(page, 0, in gfs2_write_jdata_pagevec()
304 unlock_page(page); in gfs2_write_jdata_pagevec()
308 ret = __gfs2_jdata_writepage(page, wbc); in gfs2_write_jdata_pagevec()
415 static int stuffed_readpage(struct gfs2_inode *ip, struct page *page) in stuffed_readpage() argument
427 if (unlikely(page->index)) { in stuffed_readpage()
428 zero_user(page, 0, PAGE_CACHE_SIZE); in stuffed_readpage()
429 SetPageUptodate(page); in stuffed_readpage()
437 kaddr = kmap_atomic(page); in stuffed_readpage()
443 flush_dcache_page(page); in stuffed_readpage()
445 SetPageUptodate(page); in stuffed_readpage()
462 static int __gfs2_readpage(void *file, struct page *page) in __gfs2_readpage() argument
464 struct gfs2_inode *ip = GFS2_I(page->mapping->host); in __gfs2_readpage()
465 struct gfs2_sbd *sdp = GFS2_SB(page->mapping->host); in __gfs2_readpage()
469 error = stuffed_readpage(ip, page); in __gfs2_readpage()
470 unlock_page(page); in __gfs2_readpage()
472 error = mpage_readpage(page, gfs2_block_map); in __gfs2_readpage()
491 static int gfs2_readpage(struct file *file, struct page *page) in gfs2_readpage() argument
493 struct address_space *mapping = page->mapping; in gfs2_readpage()
498 unlock_page(page); in gfs2_readpage()
504 lock_page(page); in gfs2_readpage()
505 if (page->mapping == mapping && !PageUptodate(page)) in gfs2_readpage()
506 error = __gfs2_readpage(file, page); in gfs2_readpage()
508 unlock_page(page); in gfs2_readpage()
513 lock_page(page); in gfs2_readpage()
534 struct page *page; in gfs2_internal_read() local
541 page = read_cache_page(mapping, index, __gfs2_readpage, NULL); in gfs2_internal_read()
542 if (IS_ERR(page)) in gfs2_internal_read()
543 return PTR_ERR(page); in gfs2_internal_read()
544 p = kmap_atomic(page); in gfs2_internal_read()
547 mark_page_accessed(page); in gfs2_internal_read()
548 page_cache_release(page); in gfs2_internal_read()
609 struct page **pagep, void **fsdata) in gfs2_write_begin()
620 struct page *page; in gfs2_write_begin() local
668 page = grab_cache_page_write_begin(mapping, index, flags); in gfs2_write_begin()
669 *pagep = page; in gfs2_write_begin()
670 if (unlikely(!page)) in gfs2_write_begin()
676 error = gfs2_unstuff_dinode(ip, page); in gfs2_write_begin()
679 } else if (!PageUptodate(page)) { in gfs2_write_begin()
680 error = stuffed_readpage(ip, page); in gfs2_write_begin()
686 error = __block_write_begin(page, from, len, gfs2_block_map); in gfs2_write_begin()
691 unlock_page(page); in gfs2_write_begin()
692 page_cache_release(page); in gfs2_write_begin()
773 struct page *page) in gfs2_stuffed_write_end() argument
783 kaddr = kmap_atomic(page); in gfs2_stuffed_write_end()
786 flush_dcache_page(page); in gfs2_stuffed_write_end()
789 if (!PageUptodate(page)) in gfs2_stuffed_write_end()
790 SetPageUptodate(page); in gfs2_stuffed_write_end()
791 unlock_page(page); in gfs2_stuffed_write_end()
792 page_cache_release(page); in gfs2_stuffed_write_end()
835 struct page *page, void *fsdata) in gfs2_write_end() argument
837 struct inode *inode = page->mapping->host; in gfs2_write_end()
850 unlock_page(page); in gfs2_write_end()
851 page_cache_release(page); in gfs2_write_end()
858 return gfs2_stuffed_write_end(inode, dibh, pos, len, copied, page); in gfs2_write_end()
861 gfs2_page_add_databufs(ip, page, from, to); in gfs2_write_end()
863 ret = generic_write_end(file, mapping, pos, len, copied, page, fsdata); in gfs2_write_end()
892 static int gfs2_set_page_dirty(struct page *page) in gfs2_set_page_dirty() argument
894 SetPageChecked(page); in gfs2_set_page_dirty()
895 return __set_page_dirty_buffers(page); in gfs2_set_page_dirty()
947 static void gfs2_invalidatepage(struct page *page, unsigned int offset, in gfs2_invalidatepage() argument
950 struct gfs2_sbd *sdp = GFS2_SB(page->mapping->host); in gfs2_invalidatepage()
954 BUG_ON(!PageLocked(page)); in gfs2_invalidatepage()
956 ClearPageChecked(page); in gfs2_invalidatepage()
957 if (!page_has_buffers(page)) in gfs2_invalidatepage()
960 bh = head = page_buffers(page); in gfs2_invalidatepage()
969 try_to_release_page(page, 0); in gfs2_invalidatepage()
1044 int gfs2_releasepage(struct page *page, gfp_t gfp_mask) in gfs2_releasepage() argument
1046 struct address_space *mapping = page->mapping; in gfs2_releasepage()
1051 if (!page_has_buffers(page)) in gfs2_releasepage()
1056 head = bh = page_buffers(page); in gfs2_releasepage()
1070 head = bh = page_buffers(page); in gfs2_releasepage()
1093 return try_to_free_buffers(page); in gfs2_releasepage()