Lines Matching refs:mapping

325 	return page->mapping == PAGE_MAPPING_DAX_SHARED;  in dax_page_is_shared()
334 if (page->mapping != PAGE_MAPPING_DAX_SHARED) { in dax_page_share_get()
339 if (page->mapping) in dax_page_share_get()
341 page->mapping = PAGE_MAPPING_DAX_SHARED; in dax_page_share_get()
356 static void dax_associate_entry(void *entry, struct address_space *mapping, in dax_associate_entry() argument
372 WARN_ON_ONCE(page->mapping); in dax_associate_entry()
373 page->mapping = mapping; in dax_associate_entry()
379 static void dax_disassociate_entry(void *entry, struct address_space *mapping, in dax_disassociate_entry() argument
396 WARN_ON_ONCE(page->mapping && page->mapping != mapping); in dax_disassociate_entry()
397 page->mapping = NULL; in dax_disassociate_entry()
431 struct address_space *mapping = READ_ONCE(folio->mapping); in dax_lock_folio() local
434 if (!mapping || !dax_mapping(mapping)) in dax_lock_folio()
445 if (S_ISCHR(mapping->host->i_mode)) in dax_lock_folio()
448 xas.xa = &mapping->i_pages; in dax_lock_folio()
450 if (mapping != folio->mapping) { in dax_lock_folio()
472 struct address_space *mapping = folio->mapping; in dax_unlock_folio() local
473 XA_STATE(xas, &mapping->i_pages, folio->index); in dax_unlock_folio()
475 if (S_ISCHR(mapping->host->i_mode)) in dax_unlock_folio()
490 dax_entry_t dax_lock_mapping_entry(struct address_space *mapping, pgoff_t index, in dax_lock_mapping_entry() argument
499 if (!dax_mapping(mapping)) in dax_lock_mapping_entry()
502 xas.xa = &mapping->i_pages; in dax_lock_mapping_entry()
533 void dax_unlock_mapping_entry(struct address_space *mapping, pgoff_t index, in dax_unlock_mapping_entry() argument
536 XA_STATE(xas, &mapping->i_pages, index); in dax_unlock_mapping_entry()
574 struct address_space *mapping, unsigned int order) in grab_mapping_entry() argument
616 unmap_mapping_pages(mapping, in grab_mapping_entry()
623 dax_disassociate_entry(entry, mapping, false); in grab_mapping_entry()
626 mapping->nrpages -= PG_PMD_NR; in grab_mapping_entry()
642 mapping->nrpages += 1UL << order; in grab_mapping_entry()
647 if (xas_nomem(xas, mapping_gfp_mask(mapping) & ~__GFP_HIGHMEM)) in grab_mapping_entry()
677 struct page *dax_layout_busy_page_range(struct address_space *mapping, in dax_layout_busy_page_range() argument
685 XA_STATE(xas, &mapping->i_pages, start_idx); in dax_layout_busy_page_range()
693 if (!dax_mapping(mapping) || !mapping_mapped(mapping)) in dax_layout_busy_page_range()
713 unmap_mapping_pages(mapping, start_idx, end_idx - start_idx + 1, 0); in dax_layout_busy_page_range()
739 struct page *dax_layout_busy_page(struct address_space *mapping) in dax_layout_busy_page() argument
741 return dax_layout_busy_page_range(mapping, 0, LLONG_MAX); in dax_layout_busy_page()
745 static int __dax_invalidate_entry(struct address_space *mapping, in __dax_invalidate_entry() argument
748 XA_STATE(xas, &mapping->i_pages, index); in __dax_invalidate_entry()
760 dax_disassociate_entry(entry, mapping, trunc); in __dax_invalidate_entry()
762 mapping->nrpages -= 1UL << dax_entry_order(entry); in __dax_invalidate_entry()
770 static int __dax_clear_dirty_range(struct address_space *mapping, in __dax_clear_dirty_range() argument
773 XA_STATE(xas, &mapping->i_pages, start); in __dax_clear_dirty_range()
801 int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index) in dax_delete_mapping_entry() argument
803 int ret = __dax_invalidate_entry(mapping, index, true); in dax_delete_mapping_entry()
819 int dax_invalidate_mapping_entry_sync(struct address_space *mapping, in dax_invalidate_mapping_entry_sync() argument
822 return __dax_invalidate_entry(mapping, index, false); in dax_invalidate_mapping_entry_sync()
873 struct address_space *mapping = vmf->vma->vm_file->f_mapping; in dax_insert_entry() local
880 __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); in dax_insert_entry()
886 unmap_mapping_pages(mapping, index & ~PG_PMD_COLOUR, in dax_insert_entry()
889 unmap_mapping_pages(mapping, index, 1, false); in dax_insert_entry()
897 dax_disassociate_entry(entry, mapping, false); in dax_insert_entry()
898 dax_associate_entry(new_entry, mapping, vmf->vma, vmf->address, in dax_insert_entry()
927 struct address_space *mapping, void *entry) in dax_writeback_one() argument
992 i_mmap_lock_read(mapping); in dax_writeback_one()
993 vma_interval_tree_foreach(vma, &mapping->i_mmap, index, end) { in dax_writeback_one()
997 i_mmap_unlock_read(mapping); in dax_writeback_one()
1012 trace_dax_writeback_one(mapping->host, index, count); in dax_writeback_one()
1025 int dax_writeback_mapping_range(struct address_space *mapping, in dax_writeback_mapping_range() argument
1028 XA_STATE(xas, &mapping->i_pages, wbc->range_start >> PAGE_SHIFT); in dax_writeback_mapping_range()
1029 struct inode *inode = mapping->host; in dax_writeback_mapping_range()
1038 if (mapping_empty(mapping) || wbc->sync_mode != WB_SYNC_ALL) in dax_writeback_mapping_range()
1043 tag_pages_for_writeback(mapping, xas.xa_index, end_index); in dax_writeback_mapping_range()
1047 ret = dax_writeback_one(&xas, dax_dev, mapping, entry); in dax_writeback_mapping_range()
1049 mapping_set_error(mapping, ret); in dax_writeback_mapping_range()
1205 struct address_space *mapping = vmf->vma->vm_file->f_mapping; in dax_pmd_load_hole() local
1208 struct inode *inode = mapping->host; in dax_pmd_load_hole()
1700 struct address_space *mapping = vmf->vma->vm_file->f_mapping; in dax_iomap_pte_fault() local
1701 XA_STATE(xas, &mapping->i_pages, vmf->pgoff); in dax_iomap_pte_fault()
1703 .inode = mapping->host, in dax_iomap_pte_fault()
1726 entry = grab_mapping_entry(&xas, mapping, 0); in dax_iomap_pte_fault()
1810 struct address_space *mapping = vmf->vma->vm_file->f_mapping; in dax_iomap_pmd_fault() local
1811 XA_STATE_ORDER(xas, &mapping->i_pages, vmf->pgoff, PMD_ORDER); in dax_iomap_pmd_fault()
1813 .inode = mapping->host, in dax_iomap_pmd_fault()
1847 entry = grab_mapping_entry(&xas, mapping, PMD_ORDER); in dax_iomap_pmd_fault()
1931 struct address_space *mapping = vmf->vma->vm_file->f_mapping; in dax_insert_pfn_mkwrite() local
1932 XA_STATE_ORDER(xas, &mapping->i_pages, vmf->pgoff, order); in dax_insert_pfn_mkwrite()
1943 trace_dax_insert_pfn_mkwrite_no_entry(mapping->host, vmf, in dax_insert_pfn_mkwrite()
1959 trace_dax_insert_pfn_mkwrite(mapping->host, vmf, ret); in dax_insert_pfn_mkwrite()