Lines Matching refs:page
62 struct page *page; in ntfs_end_buffer_async_read() local
67 page = bh->b_page; in ntfs_end_buffer_async_read()
68 vi = page->mapping->host; in ntfs_end_buffer_async_read()
77 file_ofs = ((s64)page->index << PAGE_CACHE_SHIFT) + in ntfs_end_buffer_async_read()
96 kaddr = kmap_atomic(page, KM_BIO_SRC_IRQ); in ntfs_end_buffer_async_read()
99 flush_dcache_page(page); in ntfs_end_buffer_async_read()
105 SetPageError(page); in ntfs_end_buffer_async_read()
109 first = page_buffers(page); in ntfs_end_buffer_async_read()
137 if (likely(page_uptodate && !PageError(page))) in ntfs_end_buffer_async_read()
138 SetPageUptodate(page); in ntfs_end_buffer_async_read()
149 kaddr = kmap_atomic(page, KM_BIO_SRC_IRQ); in ntfs_end_buffer_async_read()
155 flush_dcache_page(page); in ntfs_end_buffer_async_read()
156 if (likely(page_uptodate && !PageError(page))) in ntfs_end_buffer_async_read()
157 SetPageUptodate(page); in ntfs_end_buffer_async_read()
159 unlock_page(page); in ntfs_end_buffer_async_read()
184 static int ntfs_read_block(struct page *page) in ntfs_read_block() argument
201 vi = page->mapping->host; in ntfs_read_block()
211 if (!page_has_buffers(page)) { in ntfs_read_block()
212 create_empty_buffers(page, blocksize, 0); in ntfs_read_block()
213 if (unlikely(!page_has_buffers(page))) { in ntfs_read_block()
214 unlock_page(page); in ntfs_read_block()
218 bh = head = page_buffers(page); in ntfs_read_block()
232 iblock = (s64)page->index << (PAGE_CACHE_SHIFT - blocksize_bits); in ntfs_read_block()
322 SetPageError(page); in ntfs_read_block()
341 zero_user(page, i * blocksize, blocksize); in ntfs_read_block()
372 if (likely(!PageError(page))) in ntfs_read_block()
373 SetPageUptodate(page); in ntfs_read_block()
376 unlock_page(page); in ntfs_read_block()
398 static int ntfs_readpage(struct file *file, struct page *page) in ntfs_readpage() argument
411 BUG_ON(!PageLocked(page)); in ntfs_readpage()
412 vi = page->mapping->host; in ntfs_readpage()
415 if (unlikely(page->index >= (i_size + PAGE_CACHE_SIZE - 1) >> in ntfs_readpage()
417 zero_user(page, 0, PAGE_CACHE_SIZE); in ntfs_readpage()
425 if (PageUptodate(page)) { in ntfs_readpage()
426 unlock_page(page); in ntfs_readpage()
449 return ntfs_read_compressed_block(page); in ntfs_readpage()
455 return ntfs_read_block(page); in ntfs_readpage()
465 if (unlikely(page->index > 0)) { in ntfs_readpage()
466 zero_user(page, 0, PAGE_CACHE_SIZE); in ntfs_readpage()
506 addr = kmap_atomic(page, KM_USER0); in ntfs_readpage()
513 flush_dcache_page(page); in ntfs_readpage()
520 SetPageUptodate(page); in ntfs_readpage()
522 unlock_page(page); in ntfs_readpage()
550 static int ntfs_write_block(struct page *page, struct writeback_control *wbc) in ntfs_write_block() argument
568 vi = page->mapping->host; in ntfs_write_block()
573 "0x%lx.", ni->mft_no, ni->type, page->index); in ntfs_write_block()
579 if (!page_has_buffers(page)) { in ntfs_write_block()
580 BUG_ON(!PageUptodate(page)); in ntfs_write_block()
581 create_empty_buffers(page, blocksize, in ntfs_write_block()
583 if (unlikely(!page_has_buffers(page))) { in ntfs_write_block()
591 redirty_page_for_writepage(wbc, page); in ntfs_write_block()
592 unlock_page(page); in ntfs_write_block()
596 bh = head = page_buffers(page); in ntfs_write_block()
602 block = (s64)page->index << (PAGE_CACHE_SHIFT - blocksize_bits); in ntfs_write_block()
690 if (!PageUptodate(page)) { in ntfs_write_block()
748 kaddr = kmap_atomic(page, KM_USER0); in ntfs_write_block()
795 zero_user(page, bh_offset(bh), blocksize); in ntfs_write_block()
822 if (unlikely(!PageUptodate(page))) { in ntfs_write_block()
832 SetPageUptodate(page); in ntfs_write_block()
866 redirty_page_for_writepage(wbc, page); in ntfs_write_block()
869 SetPageError(page); in ntfs_write_block()
872 BUG_ON(PageWriteback(page)); in ntfs_write_block()
873 set_page_writeback(page); /* Keeps try_to_free_buffers() away. */ in ntfs_write_block()
885 unlock_page(page); in ntfs_write_block()
889 end_page_writeback(page); in ntfs_write_block()
919 static int ntfs_write_mst_block(struct page *page, in ntfs_write_mst_block() argument
923 struct inode *vi = page->mapping->host; in ntfs_write_mst_block()
938 "0x%lx.", vi->i_ino, ni->type, page->index); in ntfs_write_mst_block()
960 bh = head = page_buffers(page); in ntfs_write_mst_block()
969 rec_block = block = (sector_t)page->index << in ntfs_write_mst_block()
1119 kaddr = kmap(page); in ntfs_write_mst_block()
1121 BUG_ON(!PageUptodate(page)); in ntfs_write_mst_block()
1122 ClearPageUptodate(page); in ntfs_write_mst_block()
1136 mft_no = (((s64)page->index << PAGE_CACHE_SHIFT) + ofs) in ntfs_write_mst_block()
1175 ni->type, page->index, ofs); in ntfs_write_mst_block()
1191 flush_dcache_page(page); in ntfs_write_mst_block()
1223 page->index, bh_offset(tbh)); in ntfs_write_mst_block()
1252 mft_no = (((s64)page->index << PAGE_CACHE_SHIFT) + ofs) in ntfs_write_mst_block()
1272 flush_dcache_page(page); in ntfs_write_mst_block()
1295 SetPageUptodate(page); in ntfs_write_mst_block()
1296 kunmap(page); in ntfs_write_mst_block()
1304 SetPageError(page); in ntfs_write_mst_block()
1310 "record 0x%lx.", page->index << in ntfs_write_mst_block()
1312 redirty_page_for_writepage(wbc, page); in ntfs_write_mst_block()
1313 unlock_page(page); in ntfs_write_mst_block()
1320 BUG_ON(PageWriteback(page)); in ntfs_write_mst_block()
1321 set_page_writeback(page); in ntfs_write_mst_block()
1322 unlock_page(page); in ntfs_write_mst_block()
1323 end_page_writeback(page); in ntfs_write_mst_block()
1353 static int ntfs_writepage(struct page *page, struct writeback_control *wbc) in ntfs_writepage() argument
1356 struct inode *vi = page->mapping->host; in ntfs_writepage()
1365 BUG_ON(!PageLocked(page)); in ntfs_writepage()
1368 if (unlikely(page->index >= (i_size + PAGE_CACHE_SIZE - 1) >> in ntfs_writepage()
1374 block_invalidatepage(page, 0); in ntfs_writepage()
1375 unlock_page(page); in ntfs_writepage()
1390 unlock_page(page); in ntfs_writepage()
1401 unlock_page(page); in ntfs_writepage()
1408 unlock_page(page); in ntfs_writepage()
1417 if (page->index >= (i_size >> PAGE_CACHE_SHIFT)) { in ntfs_writepage()
1420 zero_user_segment(page, ofs, PAGE_CACHE_SIZE); in ntfs_writepage()
1424 return ntfs_write_mst_block(page, wbc); in ntfs_writepage()
1426 return ntfs_write_block(page, wbc); in ntfs_writepage()
1436 BUG_ON(page_has_buffers(page)); in ntfs_writepage()
1437 BUG_ON(!PageUptodate(page)); in ntfs_writepage()
1438 if (unlikely(page->index > 0)) { in ntfs_writepage()
1440 "Aborting write.", page->index); in ntfs_writepage()
1441 BUG_ON(PageWriteback(page)); in ntfs_writepage()
1442 set_page_writeback(page); in ntfs_writepage()
1443 unlock_page(page); in ntfs_writepage()
1444 end_page_writeback(page); in ntfs_writepage()
1480 BUG_ON(PageWriteback(page)); in ntfs_writepage()
1481 set_page_writeback(page); in ntfs_writepage()
1482 unlock_page(page); in ntfs_writepage()
1497 addr = kmap_atomic(page, KM_USER0); in ntfs_writepage()
1505 flush_dcache_page(page); in ntfs_writepage()
1508 end_page_writeback(page); in ntfs_writepage()
1522 redirty_page_for_writepage(wbc, page); in ntfs_writepage()
1527 SetPageError(page); in ntfs_writepage()
1530 unlock_page(page); in ntfs_writepage()
1591 void mark_ntfs_record_dirty(struct page *page, const unsigned int ofs) { in mark_ntfs_record_dirty() argument
1592 struct address_space *mapping = page->mapping; in mark_ntfs_record_dirty()
1597 BUG_ON(!PageUptodate(page)); in mark_ntfs_record_dirty()
1601 if (unlikely(!page_has_buffers(page))) { in mark_ntfs_record_dirty()
1603 bh = head = alloc_page_buffers(page, bh_size, 1); in mark_ntfs_record_dirty()
1605 if (likely(!page_has_buffers(page))) { in mark_ntfs_record_dirty()
1614 attach_page_buffers(page, head); in mark_ntfs_record_dirty()
1618 bh = head = page_buffers(page); in mark_ntfs_record_dirty()
1629 __set_page_dirty_nobuffers(page); in mark_ntfs_record_dirty()