mm: move clearing of page->mapping to page_cache_tree_delete()
[sfrench/cifs-2.6.git] / mm / filemap.c
index 014109e66e4a59875fcd4665ddd7e584fb41d3fb..c649624d386c17281e9e7a6ebe58b343a2fc0163 100644 (file)
@@ -165,6 +165,9 @@ static void page_cache_tree_delete(struct address_space *mapping,
                                     workingset_update_node, mapping);
        }
 
                                     workingset_update_node, mapping);
        }
 
+       page->mapping = NULL;
+       /* Leave page->index set: truncation lookup relies upon it */
+
        if (shadow) {
                mapping->nrexceptional += nr;
                /*
        if (shadow) {
                mapping->nrexceptional += nr;
                /*
@@ -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);
                                             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,
 }
 
 static void page_cache_free_page(struct address_space *mapping,