Skip to content

Commit 551c643

Browse files
heatdakpm00
authored andcommitted
mm: workingset: simplify lockdep check in update_node
container_of(node->array, ..., i_pages) just to access i_pages again is an incredibly roundabout way of accessing node->array itself. Simplify it. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Pedro Falcato <[email protected]> Reviewed-by: Matthew Wilcox (Oracle) <[email protected]> Acked-by: Johannes Weiner <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 31cf0dd commit 551c643

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

mm/workingset.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,6 @@ struct list_lru shadow_nodes;
612612

613613
void workingset_update_node(struct xa_node *node)
614614
{
615-
struct address_space *mapping;
616615
struct page *page = virt_to_page(node);
617616

618617
/*
@@ -623,8 +622,7 @@ void workingset_update_node(struct xa_node *node)
623622
* already where they should be. The list_empty() test is safe
624623
* as node->private_list is protected by the i_pages lock.
625624
*/
626-
mapping = container_of(node->array, struct address_space, i_pages);
627-
lockdep_assert_held(&mapping->i_pages.xa_lock);
625+
lockdep_assert_held(&node->array->xa_lock);
628626

629627
if (node->count && node->count == node->nr_values) {
630628
if (list_empty(&node->private_list)) {

0 commit comments

Comments
 (0)