X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=mm%2Ftruncate.c;h=250505091d3773e67449c547a0b16f8c67680257;hb=3bda12589646caa22b2ed4ef7cf82d17ea59d7a6;hp=894e9a70699fe8bbc7e39aa7cef7f68032cabede;hpb=2e1e9212ed8c532c6b324de77d3cafef5d2bc846;p=linux-2.6 diff --git a/mm/truncate.c b/mm/truncate.c index 894e9a7069..250505091d 100644 --- a/mm/truncate.c +++ b/mm/truncate.c @@ -187,7 +187,7 @@ void truncate_inode_pages_range(struct address_space *mapping, if (page_index > next) next = page_index; next++; - if (TestSetPageLocked(page)) + if (!trylock_page(page)) continue; if (PageWriteback(page)) { unlock_page(page); @@ -280,7 +280,7 @@ unsigned long __invalidate_mapping_pages(struct address_space *mapping, pgoff_t index; int lock_failed; - lock_failed = TestSetPageLocked(page); + lock_failed = !trylock_page(page); /* * We really shouldn't be looking at the ->index of an