summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/truncate.c1
-rw-r--r--mm/vmscan.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/mm/truncate.c b/mm/truncate.c
index 11ca480701dd..e07b1e682c38 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -96,7 +96,6 @@ invalidate_complete_page(struct address_space *mapping, struct page *page)
return 0;
ret = remove_mapping(mapping, page);
- ClearPageUptodate(page);
return ret;
}
diff --git a/mm/vmscan.c b/mm/vmscan.c
index eca70310adb2..af73c14f9d88 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -378,6 +378,12 @@ static pageout_t pageout(struct page *page, struct address_space *mapping)
return PAGE_CLEAN;
}
+/*
+ * Attempt to detach a locked page from its ->mapping. If it is dirty or if
+ * someone else has a ref on the page, abort and return 0. If it was
+ * successfully detached, return 1. Assumes the caller has a single ref on
+ * this page.
+ */
int remove_mapping(struct address_space *mapping, struct page *page)
{
BUG_ON(!PageLocked(page));