@@ -777,27 +777,28 @@ EXPORT_SYMBOL_GPL(dax_layout_busy_page);
777
777
static int __dax_invalidate_entry (struct address_space * mapping ,
778
778
pgoff_t index , bool trunc )
779
779
{
780
+ XA_STATE (xas , & mapping -> i_pages , index );
780
781
int ret = 0 ;
781
782
void * entry ;
782
- struct radix_tree_root * pages = & mapping -> i_pages ;
783
783
784
- xa_lock_irq ( pages );
785
- entry = get_unlocked_mapping_entry ( mapping , index , NULL );
784
+ xas_lock_irq ( & xas );
785
+ entry = get_unlocked_entry ( & xas );
786
786
if (!entry || WARN_ON_ONCE (!xa_is_value (entry )))
787
787
goto out ;
788
788
if (!trunc &&
789
- (radix_tree_tag_get ( pages , index , PAGECACHE_TAG_DIRTY ) ||
790
- radix_tree_tag_get ( pages , index , PAGECACHE_TAG_TOWRITE )))
789
+ (xas_get_mark ( & xas , PAGECACHE_TAG_DIRTY ) ||
790
+ xas_get_mark ( & xas , PAGECACHE_TAG_TOWRITE )))
791
791
goto out ;
792
792
dax_disassociate_entry (entry , mapping , trunc );
793
- radix_tree_delete ( pages , index );
793
+ xas_store ( & xas , NULL );
794
794
mapping -> nrexceptional -- ;
795
795
ret = 1 ;
796
796
out :
797
- put_unlocked_mapping_entry ( mapping , index , entry );
798
- xa_unlock_irq ( pages );
797
+ put_unlocked_entry ( & xas , entry );
798
+ xas_unlock_irq ( & xas );
799
799
return ret ;
800
800
}
801
+
801
802
/*
802
803
* Delete DAX entry at @index from @mapping. Wait for it
803
804
* to be unlocked before deleting it.
0 commit comments