Lines Matching full:mapping

33 file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping)  in file_ra_state_init()  argument
35 ra->ra_pages = inode_to_bdi(mapping->host)->ra_pages; in file_ra_state_init()
47 static void read_cache_pages_invalidate_page(struct address_space *mapping, in read_cache_pages_invalidate_page() argument
53 page->mapping = mapping; in read_cache_pages_invalidate_page()
55 page->mapping = NULL; in read_cache_pages_invalidate_page()
64 static void read_cache_pages_invalidate_pages(struct address_space *mapping, in read_cache_pages_invalidate_pages() argument
72 read_cache_pages_invalidate_page(mapping, victim); in read_cache_pages_invalidate_pages()
78 * @mapping: the address_space
88 int read_cache_pages(struct address_space *mapping, struct list_head *pages, in read_cache_pages() argument
97 if (add_to_page_cache_lru(page, mapping, page->index, in read_cache_pages()
98 readahead_gfp_mask(mapping))) { in read_cache_pages()
99 read_cache_pages_invalidate_page(mapping, page); in read_cache_pages()
106 read_cache_pages_invalidate_pages(mapping, pages); in read_cache_pages()
116 static int read_pages(struct address_space *mapping, struct file *filp, in read_pages() argument
125 if (mapping->a_ops->readpages) { in read_pages()
126 ret = mapping->a_ops->readpages(filp, mapping, pages, nr_pages); in read_pages()
135 if (!add_to_page_cache_lru(page, mapping, page->index, gfp)) in read_pages()
136 mapping->a_ops->readpage(filp, page); in read_pages()
155 unsigned int __do_page_cache_readahead(struct address_space *mapping, in __do_page_cache_readahead() argument
159 struct inode *inode = mapping->host; in __do_page_cache_readahead()
166 gfp_t gfp_mask = readahead_gfp_mask(mapping); in __do_page_cache_readahead()
182 page = xa_load(&mapping->i_pages, page_offset); in __do_page_cache_readahead()
190 read_pages(mapping, filp, &page_pool, nr_pages, in __do_page_cache_readahead()
212 read_pages(mapping, filp, &page_pool, nr_pages, gfp_mask); in __do_page_cache_readahead()
222 int force_page_cache_readahead(struct address_space *mapping, struct file *filp, in force_page_cache_readahead() argument
225 struct backing_dev_info *bdi = inode_to_bdi(mapping->host); in force_page_cache_readahead()
229 if (unlikely(!mapping->a_ops->readpage && !mapping->a_ops->readpages)) in force_page_cache_readahead()
243 __do_page_cache_readahead(mapping, filp, offset, this_chunk, 0); in force_page_cache_readahead()
332 static pgoff_t count_history_pages(struct address_space *mapping, in count_history_pages() argument
338 head = page_cache_prev_miss(mapping, offset - 1, max); in count_history_pages()
347 static int try_context_readahead(struct address_space *mapping, in try_context_readahead() argument
355 size = count_history_pages(mapping, offset, max); in try_context_readahead()
382 ondemand_readahead(struct address_space *mapping, in ondemand_readahead() argument
387 struct backing_dev_info *bdi = inode_to_bdi(mapping->host); in ondemand_readahead()
427 start = page_cache_next_miss(mapping, offset + 1, max_pages); in ondemand_readahead()
460 if (try_context_readahead(mapping, ra, offset, req_size, max_pages)) in ondemand_readahead()
467 return __do_page_cache_readahead(mapping, filp, offset, req_size, 0); in ondemand_readahead()
492 return ra_submit(ra, mapping, filp); in ondemand_readahead()
497 * @mapping: address_space which holds the pagecache and I/O vectors
500 * @offset: start offset into @mapping, in pagecache page-sized units
509 void page_cache_sync_readahead(struct address_space *mapping, in page_cache_sync_readahead() argument
522 force_page_cache_readahead(mapping, filp, offset, req_size); in page_cache_sync_readahead()
527 ondemand_readahead(mapping, ra, filp, false, offset, req_size); in page_cache_sync_readahead()
533 * @mapping: address_space which holds the pagecache and I/O vectors
537 * @offset: start offset into @mapping, in pagecache page-sized units
547 page_cache_async_readahead(struct address_space *mapping, in page_cache_async_readahead() argument
567 if (inode_read_congested(mapping->host)) in page_cache_async_readahead()
574 ondemand_readahead(mapping, ra, filp, true, offset, req_size); in page_cache_async_readahead()