aboutsummaryrefslogtreecommitdiffstats
path: root/mm/shmem.c
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2008-08-02 06:01:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-08-05 00:31:34 -0400
commit529ae9aaa08378cfe2a4350bded76f32cc8ff0ce (patch)
treed3ae998f9876c72a83a022805103a92111852b21 /mm/shmem.c
parente9ba9698187ddbc0c5bfcf41de0349a662d23d02 (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/shmem.c')
-rw-r--r--mm/shmem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index c1e5a3b4f758..04fb4f1ab88e 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1265,7 +1265,7 @@ repeat:
1265 } 1265 }
1266 1266
1267 /* We have to do this with page locked to prevent races */ 1267 /* We have to do this with page locked to prevent races */
1268 if (TestSetPageLocked(swappage)) { 1268 if (!trylock_page(swappage)) {
1269 shmem_swp_unmap(entry); 1269 shmem_swp_unmap(entry);
1270 spin_unlock(&info->lock); 1270 spin_unlock(&info->lock);
1271 wait_on_page_locked(swappage); 1271 wait_on_page_locked(swappage);
@@ -1329,7 +1329,7 @@ repeat:
1329 shmem_swp_unmap(entry); 1329 shmem_swp_unmap(entry);
1330 filepage = find_get_page(mapping, idx); 1330 filepage = find_get_page(mapping, idx);
1331 if (filepage && 1331 if (filepage &&
1332 (!PageUptodate(filepage) || TestSetPageLocked(filepage))) { 1332 (!PageUptodate(filepage) || !trylock_page(filepage))) {
1333 spin_unlock(&info->lock); 1333 spin_unlock(&info->lock);
1334 wait_on_page_locked(filepage); 1334 wait_on_page_locked(filepage);
1335 page_cache_release(filepage); 1335 page_cache_release(filepage);