Skip to content

Commit

Permalink
mm: move clearing of page->mapping to page_cache_tree_delete()
Browse files Browse the repository at this point in the history
Clearing of page->mapping makes sense in page_cache_tree_delete() as
well and it will help us with batching things this way.

Link: http://lkml.kernel.org/r/20171010151937.26984-6-jack@suse.cz
Signed-off-by: Jan Kara <jack@suse.cz>
Acked-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jan Kara authored and Linus Torvalds committed Nov 16, 2017
1 parent 76253fb commit 2300638
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ static void page_cache_tree_delete(struct address_space *mapping,
workingset_update_node, mapping);
}

page->mapping = NULL;
/* Leave page->index set: truncation lookup relies upon it */

if (shadow) {
mapping->nrexceptional += nr;
/*
Expand Down Expand Up @@ -250,9 +253,6 @@ void __delete_from_page_cache(struct page *page, void *shadow)
inode_to_wb(mapping->host));
}
page_cache_tree_delete(mapping, page, shadow);

page->mapping = NULL;
/* Leave page->index set: truncation lookup relies upon it */
}

static void page_cache_free_page(struct address_space *mapping,
Expand Down

0 comments on commit 2300638

Please sign in to comment.