Lines Matching full:mapping
21 static inline bool mapping_empty(struct address_space *mapping) in mapping_empty() argument
23 return xa_empty(&mapping->i_pages); in mapping_empty()
27 * Bits in mapping->flags.
42 * @mapping: the mapping in which an error should be set
43 * @error: the error to set in the mapping
51 * mapping_set_error to record the error in the mapping so that it can be
54 static inline void mapping_set_error(struct address_space *mapping, int error) in mapping_set_error() argument
60 __filemap_set_wb_err(mapping, error); in mapping_set_error()
63 if (mapping->host) in mapping_set_error()
64 errseq_set(&mapping->host->i_sb->s_wb_err, error); in mapping_set_error()
68 set_bit(AS_ENOSPC, &mapping->flags); in mapping_set_error()
70 set_bit(AS_EIO, &mapping->flags); in mapping_set_error()
73 static inline void mapping_set_unevictable(struct address_space *mapping) in mapping_set_unevictable() argument
75 set_bit(AS_UNEVICTABLE, &mapping->flags); in mapping_set_unevictable()
78 static inline void mapping_clear_unevictable(struct address_space *mapping) in mapping_clear_unevictable() argument
80 clear_bit(AS_UNEVICTABLE, &mapping->flags); in mapping_clear_unevictable()
83 static inline bool mapping_unevictable(struct address_space *mapping) in mapping_unevictable() argument
85 return mapping && test_bit(AS_UNEVICTABLE, &mapping->flags); in mapping_unevictable()
88 static inline void mapping_set_exiting(struct address_space *mapping) in mapping_set_exiting() argument
90 set_bit(AS_EXITING, &mapping->flags); in mapping_set_exiting()
93 static inline int mapping_exiting(struct address_space *mapping) in mapping_exiting() argument
95 return test_bit(AS_EXITING, &mapping->flags); in mapping_exiting()
98 static inline void mapping_set_no_writeback_tags(struct address_space *mapping) in mapping_set_no_writeback_tags() argument
100 set_bit(AS_NO_WRITEBACK_TAGS, &mapping->flags); in mapping_set_no_writeback_tags()
103 static inline int mapping_use_writeback_tags(struct address_space *mapping) in mapping_use_writeback_tags() argument
105 return !test_bit(AS_NO_WRITEBACK_TAGS, &mapping->flags); in mapping_use_writeback_tags()
108 static inline gfp_t mapping_gfp_mask(struct address_space * mapping) in mapping_gfp_mask() argument
110 return mapping->gfp_mask; in mapping_gfp_mask()
113 /* Restricts the given gfp_mask to what the mapping allows. */
114 static inline gfp_t mapping_gfp_constraint(struct address_space *mapping, in mapping_gfp_constraint() argument
117 return mapping_gfp_mask(mapping) & gfp_mask; in mapping_gfp_constraint()
121 * This is non-atomic. Only to be used before the mapping is activated.
129 static inline bool mapping_thp_support(struct address_space *mapping) in mapping_thp_support() argument
131 return test_bit(AS_THP_SUPPORT, &mapping->flags); in mapping_thp_support()
134 static inline int filemap_nr_thps(struct address_space *mapping) in filemap_nr_thps() argument
137 return atomic_read(&mapping->nr_thps); in filemap_nr_thps()
143 static inline void filemap_nr_thps_inc(struct address_space *mapping) in filemap_nr_thps_inc() argument
146 if (!mapping_thp_support(mapping)) in filemap_nr_thps_inc()
147 atomic_inc(&mapping->nr_thps); in filemap_nr_thps_inc()
153 static inline void filemap_nr_thps_dec(struct address_space *mapping) in filemap_nr_thps_dec() argument
156 if (!mapping_thp_support(mapping)) in filemap_nr_thps_dec()
157 atomic_dec(&mapping->nr_thps); in filemap_nr_thps_dec()
320 pgoff_t page_cache_next_miss(struct address_space *mapping,
322 pgoff_t page_cache_prev_miss(struct address_space *mapping,
335 struct page *pagecache_get_page(struct address_space *mapping, pgoff_t offset,
340 * @mapping: the address_space to search
343 * Looks up the page cache slot at @mapping & @offset. If there is a
348 static inline struct page *find_get_page(struct address_space *mapping, in find_get_page() argument
351 return pagecache_get_page(mapping, offset, 0, 0); in find_get_page()
354 static inline struct page *find_get_page_flags(struct address_space *mapping, in find_get_page_flags() argument
357 return pagecache_get_page(mapping, offset, fgp_flags, 0); in find_get_page_flags()
362 * @mapping: the address_space to search
365 * Looks up the page cache entry at @mapping & @index. If there is a
373 static inline struct page *find_lock_page(struct address_space *mapping, in find_lock_page() argument
376 return pagecache_get_page(mapping, index, FGP_LOCK, 0); in find_lock_page()
381 * @mapping: The address_space to search.
384 * Looks up the page cache entry at @mapping & @index. If there is a
392 static inline struct page *find_lock_head(struct address_space *mapping, in find_lock_head() argument
395 return pagecache_get_page(mapping, index, FGP_LOCK | FGP_HEAD, 0); in find_lock_head()
400 * @mapping: the page's address_space
401 * @index: the page's index into the mapping
404 * Looks up the page cache slot at @mapping & @offset. If there is a
417 static inline struct page *find_or_create_page(struct address_space *mapping, in find_or_create_page() argument
420 return pagecache_get_page(mapping, index, in find_or_create_page()
427 * @mapping: target address_space
438 static inline struct page *grab_cache_page_nowait(struct address_space *mapping, in grab_cache_page_nowait() argument
441 return pagecache_get_page(mapping, index, in grab_cache_page_nowait()
443 mapping_gfp_mask(mapping)); in grab_cache_page_nowait()
468 unsigned find_get_entries(struct address_space *mapping, pgoff_t start,
470 unsigned find_get_pages_range(struct address_space *mapping, pgoff_t *start,
473 static inline unsigned find_get_pages(struct address_space *mapping, in find_get_pages() argument
477 return find_get_pages_range(mapping, start, (pgoff_t)-1, nr_pages, in find_get_pages()
480 unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t start,
482 unsigned find_get_pages_range_tag(struct address_space *mapping, pgoff_t *index,
485 static inline unsigned find_get_pages_tag(struct address_space *mapping, in find_get_pages_tag() argument
489 return find_get_pages_range_tag(mapping, index, (pgoff_t)-1, tag, in find_get_pages_tag()
493 struct page *grab_cache_page_write_begin(struct address_space *mapping,
499 static inline struct page *grab_cache_page(struct address_space *mapping, in grab_cache_page() argument
502 return find_or_create_page(mapping, index, mapping_gfp_mask(mapping)); in grab_cache_page()
505 extern struct page * read_cache_page(struct address_space *mapping,
507 extern struct page * read_cache_page_gfp(struct address_space *mapping,
509 extern int read_cache_pages(struct address_space *mapping,
512 static inline struct page *read_mapping_page(struct address_space *mapping, in read_mapping_page() argument
515 return read_cache_page(mapping, index, NULL, data); in read_mapping_page()
792 int add_to_page_cache_locked(struct page *page, struct address_space *mapping,
794 int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
799 void delete_from_page_cache_batch(struct address_space *mapping,
809 struct address_space *mapping, pgoff_t offset, gfp_t gfp_mask) in add_to_page_cache() argument
814 error = add_to_page_cache_locked(page, mapping, offset, gfp_mask); in add_to_page_cache()
833 * @mapping: Readahead this filesystem object.
838 struct address_space *mapping; member
849 .mapping = m, \
866 * @mapping: address_space which holds the pagecache and I/O vectors
878 void page_cache_sync_readahead(struct address_space *mapping, in page_cache_sync_readahead() argument
882 DEFINE_READAHEAD(ractl, file, ra, mapping, index); in page_cache_sync_readahead()
888 * @mapping: address_space which holds the pagecache and I/O vectors
901 void page_cache_async_readahead(struct address_space *mapping, in page_cache_async_readahead() argument
905 DEFINE_READAHEAD(ractl, file, ra, mapping, index); in page_cache_async_readahead()
931 page = xa_load(&rac->mapping->i_pages, rac->_index); in readahead_page()
942 XA_STATE(xas, &rac->mapping->i_pages, 0); in __readahead_batch()
1057 if (page->mapping != inode->i_mapping) in page_mkwrite_check_truncate()