aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rmap.h
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@gmail.com>2010-10-26 17:22:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-26 19:52:09 -0400
commite9a81a821d7f9c5d899cc3acdeafbd884c2c48bb (patch)
treeaff8d136fbe592eb31d6f7911b0d430b766d00d8 /include/linux/rmap.h
parentea4525b6008fb29553306ec6719f8e6930ac9499 (diff)
rmap: wrap page_check_address() using __cond_lock()
The page_check_address() conditionally grabs *@ptlp in case of returning non-NULL. Rename and wrap it using __cond_lock() removes following warnings from sparse: mm/rmap.c:472:9: warning: context imbalance in 'page_mapped_in_vma' - unexpected unlock mm/rmap.c:524:9: warning: context imbalance in 'page_referenced_one' - unexpected unlock mm/rmap.c:706:9: warning: context imbalance in 'page_mkclean_one' - unexpected unlock mm/rmap.c:1066:9: warning: context imbalance in 'try_to_unmap_one' - unexpected unlock Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/rmap.h')
-rw-r--r--include/linux/rmap.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index 07ea89c16761..bb83c0da2071 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -205,9 +205,20 @@ int try_to_unmap_one(struct page *, struct vm_area_struct *,
205/* 205/*
206 * Called from mm/filemap_xip.c to unmap empty zero page 206 * Called from mm/filemap_xip.c to unmap empty zero page
207 */ 207 */
208pte_t *page_check_address(struct page *, struct mm_struct *, 208pte_t *__page_check_address(struct page *, struct mm_struct *,
209 unsigned long, spinlock_t **, int); 209 unsigned long, spinlock_t **, int);
210 210
211static inline pte_t *page_check_address(struct page *page, struct mm_struct *mm,
212 unsigned long address,
213 spinlock_t **ptlp, int sync)
214{
215 pte_t *ptep;
216
217 __cond_lock(*ptlp, ptep = __page_check_address(page, mm, address,
218 ptlp, sync));
219 return ptep;
220}
221
211/* 222/*
212 * Used by swapoff to help locate where page is expected in vma. 223 * Used by swapoff to help locate where page is expected in vma.
213 */ 224 */