diff options
author | Nick Piggin <npiggin@suse.de> | 2008-08-02 06:01:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-05 00:31:34 -0400 |
commit | 529ae9aaa08378cfe2a4350bded76f32cc8ff0ce (patch) | |
tree | d3ae998f9876c72a83a022805103a92111852b21 /mm/truncate.c | |
parent | e9ba9698187ddbc0c5bfcf41de0349a662d23d02 (diff) |
mm: rename page trylock
Converting page lock to new locking bitops requires a change of page flag
operation naming, so we might as well convert it to something nicer
(!TestSetPageLocked_Lock => trylock_page, SetPageLocked => set_page_locked).
This also facilitates lockdeping of page lock.
Signed-off-by: Nick Piggin <npiggin@suse.de>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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 |