diff options
Diffstat (limited to 'mm/truncate.c')
-rw-r--r-- | mm/truncate.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/mm/truncate.c b/mm/truncate.c index e68443d74567..6650c1d878b4 100644 --- a/mm/truncate.c +++ b/mm/truncate.c | |||
@@ -104,7 +104,6 @@ truncate_complete_page(struct address_space *mapping, struct page *page) | |||
104 | cancel_dirty_page(page, PAGE_CACHE_SIZE); | 104 | cancel_dirty_page(page, PAGE_CACHE_SIZE); |
105 | 105 | ||
106 | remove_from_page_cache(page); | 106 | remove_from_page_cache(page); |
107 | ClearPageUptodate(page); | ||
108 | ClearPageMappedToDisk(page); | 107 | ClearPageMappedToDisk(page); |
109 | page_cache_release(page); /* pagecache ref */ | 108 | page_cache_release(page); /* pagecache ref */ |
110 | } | 109 | } |
@@ -188,7 +187,7 @@ void truncate_inode_pages_range(struct address_space *mapping, | |||
188 | if (page_index > next) | 187 | if (page_index > next) |
189 | next = page_index; | 188 | next = page_index; |
190 | next++; | 189 | next++; |
191 | if (TestSetPageLocked(page)) | 190 | if (!trylock_page(page)) |
192 | continue; | 191 | continue; |
193 | if (PageWriteback(page)) { | 192 | if (PageWriteback(page)) { |
194 | unlock_page(page); | 193 | unlock_page(page); |
@@ -281,7 +280,7 @@ unsigned long __invalidate_mapping_pages(struct address_space *mapping, | |||
281 | pgoff_t index; | 280 | pgoff_t index; |
282 | int lock_failed; | 281 | int lock_failed; |
283 | 282 | ||
284 | lock_failed = TestSetPageLocked(page); | 283 | lock_failed = !trylock_page(page); |
285 | 284 | ||
286 | /* | 285 | /* |
287 | * We really shouldn't be looking at the ->index of an | 286 | * We really shouldn't be looking at the ->index of an |
@@ -356,7 +355,6 @@ invalidate_complete_page2(struct address_space *mapping, struct page *page) | |||
356 | BUG_ON(PagePrivate(page)); | 355 | BUG_ON(PagePrivate(page)); |
357 | __remove_from_page_cache(page); | 356 | __remove_from_page_cache(page); |
358 | spin_unlock_irq(&mapping->tree_lock); | 357 | spin_unlock_irq(&mapping->tree_lock); |
359 | ClearPageUptodate(page); | ||
360 | page_cache_release(page); /* pagecache ref */ | 358 | page_cache_release(page); /* pagecache ref */ |
361 | return 1; | 359 | return 1; |
362 | failed: | 360 | failed: |
@@ -382,7 +380,7 @@ static int do_launder_page(struct address_space *mapping, struct page *page) | |||
382 | * Any pages which are found to be mapped into pagetables are unmapped prior to | 380 | * Any pages which are found to be mapped into pagetables are unmapped prior to |
383 | * invalidation. | 381 | * invalidation. |
384 | * | 382 | * |
385 | * Returns -EIO if any pages could not be invalidated. | 383 | * Returns -EBUSY if any pages could not be invalidated. |
386 | */ | 384 | */ |
387 | int invalidate_inode_pages2_range(struct address_space *mapping, | 385 | int invalidate_inode_pages2_range(struct address_space *mapping, |
388 | pgoff_t start, pgoff_t end) | 386 | pgoff_t start, pgoff_t end) |
@@ -442,7 +440,7 @@ int invalidate_inode_pages2_range(struct address_space *mapping, | |||
442 | ret2 = do_launder_page(mapping, page); | 440 | ret2 = do_launder_page(mapping, page); |
443 | if (ret2 == 0) { | 441 | if (ret2 == 0) { |
444 | if (!invalidate_complete_page2(mapping, page)) | 442 | if (!invalidate_complete_page2(mapping, page)) |
445 | ret2 = -EIO; | 443 | ret2 = -EBUSY; |
446 | } | 444 | } |
447 | if (ret2 < 0) | 445 | if (ret2 < 0) |
448 | ret = ret2; | 446 | ret = ret2; |