aboutsummaryrefslogtreecommitdiffstats
path: root/mm/truncate.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/truncate.c')
-rw-r--r--mm/truncate.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/mm/truncate.c b/mm/truncate.c
index ea132f7ea2d2..a17b3977cfdf 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -147,6 +147,23 @@ int truncate_inode_page(struct address_space *mapping, struct page *page)
147} 147}
148 148
149/* 149/*
150 * Used to get rid of pages on hardware memory corruption.
151 */
152int generic_error_remove_page(struct address_space *mapping, struct page *page)
153{
154 if (!mapping)
155 return -EINVAL;
156 /*
157 * Only punch for normal data pages for now.
158 * Handling other types like directories would need more auditing.
159 */
160 if (!S_ISREG(mapping->host->i_mode))
161 return -EIO;
162 return truncate_inode_page(mapping, page);
163}
164EXPORT_SYMBOL(generic_error_remove_page);
165
166/*
150 * Safely invalidate one page from its pagecache mapping. 167 * Safely invalidate one page from its pagecache mapping.
151 * It only drops clean, unused pages. The page must be locked. 168 * It only drops clean, unused pages. The page must be locked.
152 * 169 *