Lines Matching full:mapping
22 * Bits in mapping->flags.
37 * @mapping: the mapping in which an error should be set
38 * @error: the error to set in the mapping
46 * mapping_set_error to record the error in the mapping so that it can be
49 static inline void mapping_set_error(struct address_space *mapping, int error) in mapping_set_error() argument
55 __filemap_set_wb_err(mapping, error); in mapping_set_error()
58 if (mapping->host) in mapping_set_error()
59 errseq_set(&mapping->host->i_sb->s_wb_err, error); in mapping_set_error()
63 set_bit(AS_ENOSPC, &mapping->flags); in mapping_set_error()
65 set_bit(AS_EIO, &mapping->flags); in mapping_set_error()
68 static inline void mapping_set_unevictable(struct address_space *mapping) in mapping_set_unevictable() argument
70 set_bit(AS_UNEVICTABLE, &mapping->flags); in mapping_set_unevictable()
73 static inline void mapping_clear_unevictable(struct address_space *mapping) in mapping_clear_unevictable() argument
75 clear_bit(AS_UNEVICTABLE, &mapping->flags); in mapping_clear_unevictable()
78 static inline bool mapping_unevictable(struct address_space *mapping) in mapping_unevictable() argument
80 return mapping && test_bit(AS_UNEVICTABLE, &mapping->flags); in mapping_unevictable()
83 static inline void mapping_set_exiting(struct address_space *mapping) in mapping_set_exiting() argument
85 set_bit(AS_EXITING, &mapping->flags); in mapping_set_exiting()
88 static inline int mapping_exiting(struct address_space *mapping) in mapping_exiting() argument
90 return test_bit(AS_EXITING, &mapping->flags); in mapping_exiting()
93 static inline void mapping_set_no_writeback_tags(struct address_space *mapping) in mapping_set_no_writeback_tags() argument
95 set_bit(AS_NO_WRITEBACK_TAGS, &mapping->flags); in mapping_set_no_writeback_tags()
98 static inline int mapping_use_writeback_tags(struct address_space *mapping) in mapping_use_writeback_tags() argument
100 return !test_bit(AS_NO_WRITEBACK_TAGS, &mapping->flags); in mapping_use_writeback_tags()
103 static inline gfp_t mapping_gfp_mask(struct address_space * mapping) in mapping_gfp_mask() argument
105 return mapping->gfp_mask; in mapping_gfp_mask()
108 /* Restricts the given gfp_mask to what the mapping allows. */
109 static inline gfp_t mapping_gfp_constraint(struct address_space *mapping, in mapping_gfp_constraint() argument
112 return mapping_gfp_mask(mapping) & gfp_mask; in mapping_gfp_constraint()
116 * This is non-atomic. Only to be used before the mapping is activated.
124 static inline bool mapping_thp_support(struct address_space *mapping) in mapping_thp_support() argument
126 return test_bit(AS_THP_SUPPORT, &mapping->flags); in mapping_thp_support()
129 static inline int filemap_nr_thps(struct address_space *mapping) in filemap_nr_thps() argument
132 return atomic_read(&mapping->nr_thps); in filemap_nr_thps()
138 static inline void filemap_nr_thps_inc(struct address_space *mapping) in filemap_nr_thps_inc() argument
141 if (!mapping_thp_support(mapping)) in filemap_nr_thps_inc()
142 atomic_inc(&mapping->nr_thps); in filemap_nr_thps_inc()
148 static inline void filemap_nr_thps_dec(struct address_space *mapping) in filemap_nr_thps_dec() argument
151 if (!mapping_thp_support(mapping)) in filemap_nr_thps_dec()
152 atomic_dec(&mapping->nr_thps); in filemap_nr_thps_dec()
305 pgoff_t page_cache_next_miss(struct address_space *mapping,
307 pgoff_t page_cache_prev_miss(struct address_space *mapping,
319 struct page *pagecache_get_page(struct address_space *mapping, pgoff_t offset,
324 * @mapping: the address_space to search
327 * Looks up the page cache slot at @mapping & @offset. If there is a
332 static inline struct page *find_get_page(struct address_space *mapping, in find_get_page() argument
335 return pagecache_get_page(mapping, offset, 0, 0); in find_get_page()
338 static inline struct page *find_get_page_flags(struct address_space *mapping, in find_get_page_flags() argument
341 return pagecache_get_page(mapping, offset, fgp_flags, 0); in find_get_page_flags()
346 * @mapping: the address_space to search
349 * Looks up the page cache entry at @mapping & @index. If there is a
357 static inline struct page *find_lock_page(struct address_space *mapping, in find_lock_page() argument
360 return pagecache_get_page(mapping, index, FGP_LOCK, 0); in find_lock_page()
365 * @mapping: The address_space to search.
368 * Looks up the page cache entry at @mapping & @index. If there is a
376 static inline struct page *find_lock_head(struct address_space *mapping, in find_lock_head() argument
379 return pagecache_get_page(mapping, index, FGP_LOCK | FGP_HEAD, 0); in find_lock_head()
384 * @mapping: the page's address_space
385 * @index: the page's index into the mapping
388 * Looks up the page cache slot at @mapping & @offset. If there is a
401 static inline struct page *find_or_create_page(struct address_space *mapping, in find_or_create_page() argument
404 return pagecache_get_page(mapping, index, in find_or_create_page()
411 * @mapping: target address_space
422 static inline struct page *grab_cache_page_nowait(struct address_space *mapping, in grab_cache_page_nowait() argument
425 return pagecache_get_page(mapping, index, in grab_cache_page_nowait()
427 mapping_gfp_mask(mapping)); in grab_cache_page_nowait()
452 unsigned find_get_entries(struct address_space *mapping, pgoff_t start,
455 unsigned find_get_pages_range(struct address_space *mapping, pgoff_t *start,
458 static inline unsigned find_get_pages(struct address_space *mapping, in find_get_pages() argument
462 return find_get_pages_range(mapping, start, (pgoff_t)-1, nr_pages, in find_get_pages()
465 unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t start,
467 unsigned find_get_pages_range_tag(struct address_space *mapping, pgoff_t *index,
470 static inline unsigned find_get_pages_tag(struct address_space *mapping, in find_get_pages_tag() argument
474 return find_get_pages_range_tag(mapping, index, (pgoff_t)-1, tag, in find_get_pages_tag()
478 struct page *grab_cache_page_write_begin(struct address_space *mapping,
484 static inline struct page *grab_cache_page(struct address_space *mapping, in grab_cache_page() argument
487 return find_or_create_page(mapping, index, mapping_gfp_mask(mapping)); in grab_cache_page()
490 extern struct page * read_cache_page(struct address_space *mapping,
492 extern struct page * read_cache_page_gfp(struct address_space *mapping,
494 extern int read_cache_pages(struct address_space *mapping,
497 static inline struct page *read_mapping_page(struct address_space *mapping, in read_mapping_page() argument
500 return read_cache_page(mapping, index, NULL, data); in read_mapping_page()
754 int add_to_page_cache_locked(struct page *page, struct address_space *mapping,
756 int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
761 void delete_from_page_cache_batch(struct address_space *mapping,
769 struct address_space *mapping, pgoff_t offset, gfp_t gfp_mask) in add_to_page_cache() argument
774 error = add_to_page_cache_locked(page, mapping, offset, gfp_mask); in add_to_page_cache()
793 * @mapping: Readahead this filesystem object.
797 struct address_space *mapping; member
807 .mapping = m, \
822 * @mapping: address_space which holds the pagecache and I/O vectors
834 void page_cache_sync_readahead(struct address_space *mapping, in page_cache_sync_readahead() argument
838 DEFINE_READAHEAD(ractl, file, mapping, index); in page_cache_sync_readahead()
844 * @mapping: address_space which holds the pagecache and I/O vectors
857 void page_cache_async_readahead(struct address_space *mapping, in page_cache_async_readahead() argument
861 DEFINE_READAHEAD(ractl, file, mapping, index); in page_cache_async_readahead()
887 page = xa_load(&rac->mapping->i_pages, rac->_index); in readahead_page()
898 XA_STATE(xas, &rac->mapping->i_pages, 0); in __readahead_batch()
1004 if (page->mapping != inode->i_mapping) in page_mkwrite_check_truncate()