Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 529ae9aa authored by Nick Piggin's avatar Nick Piggin Committed by Linus Torvalds
Browse files

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: default avatarNick Piggin <npiggin@suse.de>
Acked-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
Acked-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e9ba9698
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1747,7 +1747,7 @@ st_map_user_pages(struct scatterlist *sgl, const unsigned int max_pages,
                 */
		flush_dcache_page(pages[i]);
		/* ?? Is locking needed? I don't think so */
		/* if (TestSetPageLocked(pages[i]))
		/* if (!trylock_page(pages[i]))
		   goto out_unlock; */
        }

+1 −1
Original line number Diff line number Diff line
@@ -404,7 +404,7 @@ static int afs_write_back_from_locked_page(struct afs_writeback *wb,
			page = pages[loop];
			if (page->index > wb->last)
				break;
			if (TestSetPageLocked(page))
			if (!trylock_page(page))
				break;
			if (!PageDirty(page) ||
			    page_private(page) != (unsigned long) wb) {
+1 −1
Original line number Diff line number Diff line
@@ -1280,7 +1280,7 @@ static int cifs_writepages(struct address_space *mapping,

			if (first < 0)
				lock_page(page);
			else if (TestSetPageLocked(page))
			else if (!trylock_page(page))
				break;

			if (unlikely(page->mapping != mapping)) {
+2 −2
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ static void release_buffer_page(struct buffer_head *bh)
		goto nope;

	/* OK, it's a truncated page */
	if (TestSetPageLocked(page))
	if (!trylock_page(page))
		goto nope;

	page_cache_get(page);
@@ -446,7 +446,7 @@ void journal_commit_transaction(journal_t *journal)
			spin_lock(&journal->j_list_lock);
		}
		if (unlikely(!buffer_uptodate(bh))) {
			if (TestSetPageLocked(bh->b_page)) {
			if (!trylock_page(bh->b_page)) {
				spin_unlock(&journal->j_list_lock);
				lock_page(bh->b_page);
				spin_lock(&journal->j_list_lock);
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ static void release_buffer_page(struct buffer_head *bh)
		goto nope;

	/* OK, it's a truncated page */
	if (TestSetPageLocked(page))
	if (!trylock_page(page))
		goto nope;

	page_cache_get(page);
Loading