diff options
Diffstat (limited to 'mm/truncate.c')
-rw-r--r-- | mm/truncate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/truncate.c b/mm/truncate.c index 894e9a70699f..250505091d37 100644 --- a/mm/truncate.c +++ b/mm/truncate.c | |||
@@ -187,7 +187,7 @@ void truncate_inode_pages_range(struct address_space *mapping, | |||
187 | if (page_index > next) | 187 | if (page_index > next) |
188 | next = page_index; | 188 | next = page_index; |
189 | next++; | 189 | next++; |
190 | if (TestSetPageLocked(page)) | 190 | if (!trylock_page(page)) |
191 | continue; | 191 | continue; |
192 | if (PageWriteback(page)) { | 192 | if (PageWriteback(page)) { |
193 | unlock_page(page); | 193 | unlock_page(page); |
@@ -280,7 +280,7 @@ unsigned long __invalidate_mapping_pages(struct address_space *mapping, | |||
280 | pgoff_t index; | 280 | pgoff_t index; |
281 | int lock_failed; | 281 | int lock_failed; |
282 | 282 | ||
283 | lock_failed = TestSetPageLocked(page); | 283 | lock_failed = !trylock_page(page); |
284 | 284 | ||
285 | /* | 285 | /* |
286 | * We really shouldn't be looking at the ->index of an | 286 | * We really shouldn't be looking at the ->index of an |