Lines Matching refs:folio
53 folio_set_error(fi.folio); in mpage_read_end_io()
55 folio_mark_uptodate(fi.folio); in mpage_read_end_io()
56 folio_unlock(fi.folio); in mpage_read_end_io()
69 folio_set_error(fi.folio); in mpage_write_end_io()
70 mapping_set_error(fi.folio->mapping, err); in mpage_write_end_io()
72 folio_end_writeback(fi.folio); in mpage_write_end_io()
104 static void map_buffer_to_folio(struct folio *folio, struct buffer_head *bh, in map_buffer_to_folio() argument
107 struct inode *inode = folio->mapping->host; in map_buffer_to_folio()
111 head = folio_buffers(folio); in map_buffer_to_folio()
119 folio_mark_uptodate(folio); in map_buffer_to_folio()
122 create_empty_buffers(&folio->page, i_blocksize(inode), 0); in map_buffer_to_folio()
123 head = folio_buffers(folio); in map_buffer_to_folio()
141 struct folio *folio; member
161 struct folio *folio = args->folio; in do_mpage_readpage() local
162 struct inode *inode = folio->mapping->host; in do_mpage_readpage()
179 gfp_t gfp = mapping_gfp_constraint(folio->mapping, GFP_KERNEL); in do_mpage_readpage()
182 VM_BUG_ON_FOLIO(folio_test_large(folio), folio); in do_mpage_readpage()
189 if (folio_buffers(folio)) in do_mpage_readpage()
192 block_in_file = (sector_t)folio->index << (PAGE_SHIFT - blkbits); in do_mpage_readpage()
227 map_bh->b_folio = folio; in do_mpage_readpage()
255 map_buffer_to_folio(folio, map_bh, page_block); in do_mpage_readpage()
280 folio_zero_segment(folio, first_hole << blkbits, PAGE_SIZE); in do_mpage_readpage()
282 folio_mark_uptodate(folio); in do_mpage_readpage()
283 folio_unlock(folio); in do_mpage_readpage()
287 folio_set_mappedtodisk(folio); in do_mpage_readpage()
306 if (!bio_add_folio(args->bio, folio, length, 0)) { in do_mpage_readpage()
324 if (!folio_test_uptodate(folio)) in do_mpage_readpage()
325 block_read_full_folio(folio, args->get_block); in do_mpage_readpage()
327 folio_unlock(folio); in do_mpage_readpage()
372 struct folio *folio; in mpage_readahead() local
378 while ((folio = readahead_folio(rac))) { in mpage_readahead()
379 prefetchw(&folio->flags); in mpage_readahead()
380 args.folio = folio; in mpage_readahead()
392 int mpage_read_folio(struct folio *folio, get_block_t get_block) in mpage_read_folio() argument
395 .folio = folio, in mpage_read_folio()
469 static int __mpage_writepage(struct folio *folio, struct writeback_control *wbc, in __mpage_writepage() argument
474 struct address_space *mapping = folio->mapping; in __mpage_writepage()
491 struct buffer_head *head = folio_buffers(folio); in __mpage_writepage()
545 BUG_ON(!folio_test_uptodate(folio)); in __mpage_writepage()
546 block_in_file = (sector_t)folio->index << (PAGE_SHIFT - blkbits); in __mpage_writepage()
554 map_bh.b_folio = folio; in __mpage_writepage()
586 if (folio_pos(folio) >= i_size) in __mpage_writepage()
588 length = folio_size(folio); in __mpage_writepage()
589 if (folio_pos(folio) + length > i_size) { in __mpage_writepage()
598 length = i_size - folio_pos(folio); in __mpage_writepage()
599 folio_zero_segment(folio, length, folio_size(folio)); in __mpage_writepage()
622 wbc_account_cgroup_owner(wbc, &folio->page, folio_size(folio)); in __mpage_writepage()
624 if (!bio_add_folio(bio, folio, length, 0)) { in __mpage_writepage()
629 clean_buffers(&folio->page, first_unmapped); in __mpage_writepage()
631 BUG_ON(folio_test_writeback(folio)); in __mpage_writepage()
632 folio_start_writeback(folio); in __mpage_writepage()
633 folio_unlock(folio); in __mpage_writepage()
652 ret = block_write_full_page(&folio->page, mpd->get_block, wbc); in __mpage_writepage()