summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorMatthew Wilcox <mawilcox@microsoft.com>2017-01-16 17:10:21 -0500
committerMatthew Wilcox <mawilcox@microsoft.com>2017-02-10 10:20:49 -0500
commitbfeefaed406a113fa358728528805f6aa44cd35d (patch)
tree9387eef75f60820baf2d8e66ffc94b116b9c1e2c /mm
parentdb6009050147ce1866a2b9a0bebb915a1a488038 (diff)
radix-tree: Store a pointer to the root in each node
Instead of having this mysterious private_data in each radix_tree_node, store a pointer to the root, which can be useful for debugging. This also relieves the mm code from the duty of updating it. Acked-by: Johannes Weiner <hannes@cmpxchg.org> Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Diffstat (limited to 'mm')
-rw-r--r--mm/workingset.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/mm/workingset.c b/mm/workingset.c
index abb58ffa3c64..80c913c89f11 100644
--- a/mm/workingset.c
+++ b/mm/workingset.c
@@ -354,10 +354,8 @@ void workingset_update_node(struct radix_tree_node *node, void *private)
* as node->private_list is protected by &mapping->tree_lock.
*/
if (node->count && node->count == node->exceptional) {
- if (list_empty(&node->private_list)) {
- node->private_data = mapping;
+ if (list_empty(&node->private_list))
list_lru_add(&shadow_nodes, &node->private_list);
- }
} else {
if (!list_empty(&node->private_list))
list_lru_del(&shadow_nodes, &node->private_list);
@@ -435,7 +433,7 @@ static enum lru_status shadow_lru_isolate(struct list_head *item,
*/
node = container_of(item, struct radix_tree_node, private_list);
- mapping = node->private_data;
+ mapping = container_of(node->root, struct address_space, page_tree);
/* Coming from the list, invert the lock order */
if (!spin_trylock(&mapping->tree_lock)) {