aboutsummaryrefslogtreecommitdiffstats
path: root/mm/truncate.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/truncate.c')
-rw-r--r--mm/truncate.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/mm/truncate.c b/mm/truncate.c
index 3c2d5ddfa0d4..d64296be00d3 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -225,6 +225,7 @@ void truncate_inode_pages_range(struct address_space *mapping,
225 next = start; 225 next = start;
226 while (next <= end && 226 while (next <= end &&
227 pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)) { 227 pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)) {
228 mem_cgroup_uncharge_start();
228 for (i = 0; i < pagevec_count(&pvec); i++) { 229 for (i = 0; i < pagevec_count(&pvec); i++) {
229 struct page *page = pvec.pages[i]; 230 struct page *page = pvec.pages[i];
230 pgoff_t page_index = page->index; 231 pgoff_t page_index = page->index;
@@ -247,6 +248,7 @@ void truncate_inode_pages_range(struct address_space *mapping,
247 unlock_page(page); 248 unlock_page(page);
248 } 249 }
249 pagevec_release(&pvec); 250 pagevec_release(&pvec);
251 mem_cgroup_uncharge_end();
250 cond_resched(); 252 cond_resched();
251 } 253 }
252 254
@@ -549,13 +551,12 @@ EXPORT_SYMBOL(truncate_pagecache);
549 * @inode: inode 551 * @inode: inode
550 * @newsize: new file size 552 * @newsize: new file size
551 * 553 *
552 * truncate_setsize updastes i_size update and performs pagecache 554 * truncate_setsize updates i_size and performs pagecache truncation (if
553 * truncation (if necessary) for a file size updates. It will be 555 * necessary) to @newsize. It will be typically be called from the filesystem's
554 * typically be called from the filesystem's setattr function when 556 * setattr function when ATTR_SIZE is passed in.
555 * ATTR_SIZE is passed in.
556 * 557 *
557 * Must be called with inode_mutex held and after all filesystem 558 * Must be called with inode_mutex held and before all filesystem specific
558 * specific block truncation has been performed. 559 * block truncation has been performed.
559 */ 560 */
560void truncate_setsize(struct inode *inode, loff_t newsize) 561void truncate_setsize(struct inode *inode, loff_t newsize)
561{ 562{