Lines Matching refs:mapping
2074 int balance_dirty_pages_ratelimited_flags(struct address_space *mapping, in balance_dirty_pages_ratelimited_flags() argument
2077 struct inode *inode = mapping->host; in balance_dirty_pages_ratelimited_flags()
2144 void balance_dirty_pages_ratelimited(struct address_space *mapping) in balance_dirty_pages_ratelimited() argument
2146 balance_dirty_pages_ratelimited_flags(mapping, 0); in balance_dirty_pages_ratelimited()
2411 void tag_pages_for_writeback(struct address_space *mapping, in tag_pages_for_writeback() argument
2414 XA_STATE(xas, &mapping->i_pages, start); in tag_pages_for_writeback()
2433 static bool folio_prepare_writeback(struct address_space *mapping, in folio_prepare_writeback() argument
2443 if (unlikely(folio->mapping != mapping)) in folio_prepare_writeback()
2479 static struct folio *writeback_get_folio(struct address_space *mapping, in writeback_get_folio() argument
2489 filemap_get_folios_tag(mapping, &wbc->index, wbc_end(wbc), in writeback_get_folio()
2497 if (unlikely(!folio_prepare_writeback(mapping, wbc, folio))) { in writeback_get_folio()
2502 trace_wbc_writepage(wbc, inode_to_bdi(mapping->host)); in writeback_get_folio()
2532 struct folio *writeback_iter(struct address_space *mapping, in writeback_iter() argument
2547 wbc->index = mapping->writeback_index; in writeback_iter()
2563 tag_pages_for_writeback(mapping, wbc->index, in writeback_iter()
2590 folio = writeback_get_folio(mapping, wbc); in writeback_iter()
2603 mapping->writeback_index = 0; in writeback_iter()
2615 mapping->writeback_index = folio_next_index(folio); in writeback_iter()
2632 int write_cache_pages(struct address_space *mapping, in write_cache_pages() argument
2639 while ((folio = writeback_iter(mapping, wbc, folio, &error))) { in write_cache_pages()
2651 static int writeback_use_writepage(struct address_space *mapping, in writeback_use_writepage() argument
2659 while ((folio = writeback_iter(mapping, wbc, folio, &err))) { in writeback_use_writepage()
2660 err = mapping->a_ops->writepage(&folio->page, wbc); in writeback_use_writepage()
2665 mapping_set_error(mapping, err); in writeback_use_writepage()
2672 int do_writepages(struct address_space *mapping, struct writeback_control *wbc) in do_writepages() argument
2679 wb = inode_to_wb_wbc(mapping->host, wbc); in do_writepages()
2682 if (mapping->a_ops->writepages) { in do_writepages()
2683 ret = mapping->a_ops->writepages(mapping, wbc); in do_writepages()
2684 } else if (mapping->a_ops->writepage) { in do_writepages()
2685 ret = writeback_use_writepage(mapping, wbc); in do_writepages()
2716 bool noop_dirty_folio(struct address_space *mapping, struct folio *folio) in noop_dirty_folio() argument
2732 struct address_space *mapping) in folio_account_dirtied() argument
2734 struct inode *inode = mapping->host; in folio_account_dirtied()
2736 trace_writeback_dirty_folio(folio, mapping); in folio_account_dirtied()
2738 if (mapping_can_writeback(mapping)) { in folio_account_dirtied()
2789 void __folio_mark_dirty(struct folio *folio, struct address_space *mapping, in __folio_mark_dirty() argument
2794 xa_lock_irqsave(&mapping->i_pages, flags); in __folio_mark_dirty()
2795 if (folio->mapping) { /* Race with truncate? */ in __folio_mark_dirty()
2797 folio_account_dirtied(folio, mapping); in __folio_mark_dirty()
2798 __xa_set_mark(&mapping->i_pages, folio_index(folio), in __folio_mark_dirty()
2801 xa_unlock_irqrestore(&mapping->i_pages, flags); in __folio_mark_dirty()
2823 bool filemap_dirty_folio(struct address_space *mapping, struct folio *folio) in filemap_dirty_folio() argument
2831 __folio_mark_dirty(folio, mapping, !folio_test_private(folio)); in filemap_dirty_folio()
2834 if (mapping->host) { in filemap_dirty_folio()
2836 __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); in filemap_dirty_folio()
2857 struct address_space *mapping = folio->mapping; in folio_redirty_for_writepage() local
2862 ret = filemap_dirty_folio(mapping, folio); in folio_redirty_for_writepage()
2863 if (mapping && mapping_can_writeback(mapping)) { in folio_redirty_for_writepage()
2864 struct inode *inode = mapping->host; in folio_redirty_for_writepage()
2893 struct address_space *mapping = folio_mapping(folio); in folio_mark_dirty() local
2895 if (likely(mapping)) { in folio_mark_dirty()
2909 return mapping->a_ops->dirty_folio(mapping, folio); in folio_mark_dirty()
2912 return noop_dirty_folio(mapping, folio); in folio_mark_dirty()
2952 struct address_space *mapping = folio_mapping(folio); in __folio_cancel_dirty() local
2954 if (mapping_can_writeback(mapping)) { in __folio_cancel_dirty()
2955 struct inode *inode = mapping->host; in __folio_cancel_dirty()
2989 struct address_space *mapping = folio_mapping(folio); in folio_clear_dirty_for_io() local
2994 if (mapping && mapping_can_writeback(mapping)) { in folio_clear_dirty_for_io()
2995 struct inode *inode = mapping->host; in folio_clear_dirty_for_io()
3074 struct address_space *mapping = folio_mapping(folio); in __folio_end_writeback() local
3078 if (mapping && mapping_use_writeback_tags(mapping)) { in __folio_end_writeback()
3079 struct inode *inode = mapping->host; in __folio_end_writeback()
3083 xa_lock_irqsave(&mapping->i_pages, flags); in __folio_end_writeback()
3085 __xa_clear_mark(&mapping->i_pages, folio_index(folio), in __folio_end_writeback()
3092 if (!mapping_tagged(mapping, PAGECACHE_TAG_WRITEBACK)) in __folio_end_writeback()
3096 if (mapping->host && !mapping_tagged(mapping, in __folio_end_writeback()
3098 sb_clear_inode_writeback(mapping->host); in __folio_end_writeback()
3100 xa_unlock_irqrestore(&mapping->i_pages, flags); in __folio_end_writeback()
3116 struct address_space *mapping = folio_mapping(folio); in __folio_start_writeback() local
3122 if (mapping && mapping_use_writeback_tags(mapping)) { in __folio_start_writeback()
3123 XA_STATE(xas, &mapping->i_pages, folio_index(folio)); in __folio_start_writeback()
3124 struct inode *inode = mapping->host; in __folio_start_writeback()
3133 on_wblist = mapping_tagged(mapping, PAGECACHE_TAG_WRITEBACK); in __folio_start_writeback()
3149 if (mapping->host && !on_wblist) in __folio_start_writeback()
3150 sb_mark_inode_writeback(mapping->host); in __folio_start_writeback()