aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@gmail.com>2010-10-26 17:21:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-26 19:52:09 -0400
commit25ca1d6c02fe1c6d90d918867ef670d323725458 (patch)
treede1709dd1dc7e0b9e9bd91840beb02f12e56b7e0 /include/linux/mm.h
parente6223a3b19421e3a8df1352d21fd0d71093f44ae (diff)
mm: wrap get_locked_pte() using __cond_lock()
The get_locked_pte() conditionally grabs 'ptl' in case of returning non-NULL. This leads sparse to complain about context imbalance. Rename and wrap it using __cond_lock() to make sparse happy. 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/mm.h')
-rw-r--r--include/linux/mm.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 3bf46655b50a..721f451c3029 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1034,7 +1034,15 @@ extern void unregister_shrinker(struct shrinker *);
1034 1034
1035int vma_wants_writenotify(struct vm_area_struct *vma); 1035int vma_wants_writenotify(struct vm_area_struct *vma);
1036 1036
1037extern pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl); 1037extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr,
1038 spinlock_t **ptl);
1039static inline pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr,
1040 spinlock_t **ptl)
1041{
1042 pte_t *ptep;
1043 __cond_lock(*ptl, ptep = __get_locked_pte(mm, addr, ptl));
1044 return ptep;
1045}
1038 1046
1039#ifdef __PAGETABLE_PUD_FOLDED 1047#ifdef __PAGETABLE_PUD_FOLDED
1040static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, 1048static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd,