summaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2015-02-12 17:59:59 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-12 21:54:10 -0500
commit2d2f5119b8bb057595e18f5b2f07aa097ea1b233 (patch)
tree60d98464937b95ad2f68220251c998dfe461830b /include/linux/mm.h
parentf48b80a5e22200347e91f96b8b237b24b93c7192 (diff)
mm: do not use mm->nr_pmds on !MMU configurations
mm->nr_pmds doesn't make sense on !MMU configurations Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Guenter Roeck <linux@roeck-us.net> 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.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index af4ff88a11e0..bd52e2f14027 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1447,13 +1447,15 @@ static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd,
1447int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address); 1447int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address);
1448#endif 1448#endif
1449 1449
1450#ifdef __PAGETABLE_PMD_FOLDED 1450#if defined(__PAGETABLE_PMD_FOLDED) || !defined(CONFIG_MMU)
1451static inline int __pmd_alloc(struct mm_struct *mm, pud_t *pud, 1451static inline int __pmd_alloc(struct mm_struct *mm, pud_t *pud,
1452 unsigned long address) 1452 unsigned long address)
1453{ 1453{
1454 return 0; 1454 return 0;
1455} 1455}
1456 1456
1457static inline void mm_nr_pmds_init(struct mm_struct *mm) {}
1458
1457static inline unsigned long mm_nr_pmds(struct mm_struct *mm) 1459static inline unsigned long mm_nr_pmds(struct mm_struct *mm)
1458{ 1460{
1459 return 0; 1461 return 0;
@@ -1465,6 +1467,11 @@ static inline void mm_dec_nr_pmds(struct mm_struct *mm) {}
1465#else 1467#else
1466int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); 1468int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address);
1467 1469
1470static inline void mm_nr_pmds_init(struct mm_struct *mm)
1471{
1472 atomic_long_set(&mm->nr_pmds, 0);
1473}
1474
1468static inline unsigned long mm_nr_pmds(struct mm_struct *mm) 1475static inline unsigned long mm_nr_pmds(struct mm_struct *mm)
1469{ 1476{
1470 return atomic_long_read(&mm->nr_pmds); 1477 return atomic_long_read(&mm->nr_pmds);