diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-08-14 06:19:59 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-14 06:19:59 -0400 |
commit | 8d7ccaa545490cdffdfaff0842436a8dd85cf47b (patch) | |
tree | 8129b5907161bc6ae26deb3645ce1e280c5e1f51 /mm/truncate.c | |
parent | b2139aa0eec330c711c5a279db361e5ef1178e78 (diff) | |
parent | 30a2f3c60a84092c8084dfe788b710f8d0768cd4 (diff) |
Merge commit 'v2.6.27-rc3' into x86/prototypes
Conflicts:
include/asm-x86/dma-mapping.h
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'mm/truncate.c')
-rw-r--r-- | mm/truncate.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/mm/truncate.c b/mm/truncate.c index b8961cb63414..250505091d37 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 |
@@ -349,18 +348,17 @@ invalidate_complete_page2(struct address_space *mapping, struct page *page) | |||
349 | if (PagePrivate(page) && !try_to_release_page(page, GFP_KERNEL)) | 348 | if (PagePrivate(page) && !try_to_release_page(page, GFP_KERNEL)) |
350 | return 0; | 349 | return 0; |
351 | 350 | ||
352 | write_lock_irq(&mapping->tree_lock); | 351 | spin_lock_irq(&mapping->tree_lock); |
353 | if (PageDirty(page)) | 352 | if (PageDirty(page)) |
354 | goto failed; | 353 | goto failed; |
355 | 354 | ||
356 | BUG_ON(PagePrivate(page)); | 355 | BUG_ON(PagePrivate(page)); |
357 | __remove_from_page_cache(page); | 356 | __remove_from_page_cache(page); |
358 | write_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: |
363 | write_unlock_irq(&mapping->tree_lock); | 361 | spin_unlock_irq(&mapping->tree_lock); |
364 | return 0; | 362 | return 0; |
365 | } | 363 | } |
366 | 364 | ||