|
@@ -460,35 +460,6 @@ int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index)
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
-/*
|
|
|
|
- * Invalidate exceptional DAX entry if easily possible. This handles DAX
|
|
|
|
- * entries for invalidate_inode_pages() so we evict the entry only if we can
|
|
|
|
- * do so without blocking.
|
|
|
|
- */
|
|
|
|
-int dax_invalidate_mapping_entry(struct address_space *mapping, pgoff_t index)
|
|
|
|
-{
|
|
|
|
- int ret = 0;
|
|
|
|
- void *entry, **slot;
|
|
|
|
- struct radix_tree_root *page_tree = &mapping->page_tree;
|
|
|
|
-
|
|
|
|
- spin_lock_irq(&mapping->tree_lock);
|
|
|
|
- entry = __radix_tree_lookup(page_tree, index, NULL, &slot);
|
|
|
|
- if (!entry || !radix_tree_exceptional_entry(entry) ||
|
|
|
|
- slot_locked(mapping, slot))
|
|
|
|
- goto out;
|
|
|
|
- if (radix_tree_tag_get(page_tree, index, PAGECACHE_TAG_DIRTY) ||
|
|
|
|
- radix_tree_tag_get(page_tree, index, PAGECACHE_TAG_TOWRITE))
|
|
|
|
- goto out;
|
|
|
|
- radix_tree_delete(page_tree, index);
|
|
|
|
- mapping->nrexceptional--;
|
|
|
|
- ret = 1;
|
|
|
|
-out:
|
|
|
|
- spin_unlock_irq(&mapping->tree_lock);
|
|
|
|
- if (ret)
|
|
|
|
- dax_wake_mapping_entry_waiter(mapping, index, entry, true);
|
|
|
|
- return ret;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
* Invalidate exceptional DAX entry if it is clean.
|
|
* Invalidate exceptional DAX entry if it is clean.
|
|
*/
|
|
*/
|