diff options
| author | Nick Piggin <[email protected]> | 2008-08-02 10:01:03 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2008-08-05 04:31:34 +0000 |
| commit | 529ae9aaa08378cfe2a4350bded76f32cc8ff0ce (patch) | |
| tree | d3ae998f9876c72a83a022805103a92111852b21 /mm/truncate.c | |
| parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 (diff) | |
| download | kernel-529ae9aaa08378cfe2a4350bded76f32cc8ff0ce.tar.gz kernel-529ae9aaa08378cfe2a4350bded76f32cc8ff0ce.zip | |
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 <[email protected]>
Acked-by: KOSAKI Motohiro <[email protected]>
Acked-by: Peter Zijlstra <[email protected]>
Acked-by: Andrew Morton <[email protected]>
Acked-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
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, 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 |
