From 97fc756171d01739157adfa44e28deb8531a824e Mon Sep 17 00:00:00 2001 From: OGAWA Hirofumi Date: Wed, 13 Jan 2010 21:14:09 +0900 Subject: [PATCH] --- yaml --- r: 179211 b: refs/heads/master c: cedabed49b39b4319bccc059a63344b6232b619c h: refs/heads/master i: 179209: 9aa77829be8e36b04f57cc88a4f95480c022b4da 179207: 78fdd550bcb252df72c6e8bbfa586ca3542036d9 v: v3 --- [refs] | 2 +- trunk/mm/truncate.c | 30 ++++++++++++++---------------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/[refs] b/[refs] index 5f6a1a32ff75..9c7dfbb0dd0c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e80c14e1ae3cb637d1959a6c9a199ba2e7af5910 +refs/heads/master: cedabed49b39b4319bccc059a63344b6232b619c diff --git a/trunk/mm/truncate.c b/trunk/mm/truncate.c index 342deee22684..e87e37244829 100644 --- a/trunk/mm/truncate.c +++ b/trunk/mm/truncate.c @@ -522,22 +522,20 @@ EXPORT_SYMBOL_GPL(invalidate_inode_pages2); */ void truncate_pagecache(struct inode *inode, loff_t old, loff_t new) { - if (new < old) { - struct address_space *mapping = inode->i_mapping; - - /* - * unmap_mapping_range is called twice, first simply for - * efficiency so that truncate_inode_pages does fewer - * single-page unmaps. However after this first call, and - * before truncate_inode_pages finishes, it is possible for - * private pages to be COWed, which remain after - * truncate_inode_pages finishes, hence the second - * unmap_mapping_range call must be made for correctness. - */ - unmap_mapping_range(mapping, new + PAGE_SIZE - 1, 0, 1); - truncate_inode_pages(mapping, new); - unmap_mapping_range(mapping, new + PAGE_SIZE - 1, 0, 1); - } + struct address_space *mapping = inode->i_mapping; + + /* + * unmap_mapping_range is called twice, first simply for + * efficiency so that truncate_inode_pages does fewer + * single-page unmaps. However after this first call, and + * before truncate_inode_pages finishes, it is possible for + * private pages to be COWed, which remain after + * truncate_inode_pages finishes, hence the second + * unmap_mapping_range call must be made for correctness. + */ + unmap_mapping_range(mapping, new + PAGE_SIZE - 1, 0, 1); + truncate_inode_pages(mapping, new); + unmap_mapping_range(mapping, new + PAGE_SIZE - 1, 0, 1); } EXPORT_SYMBOL(truncate_pagecache);