aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2016-01-21 19:40:25 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-21 20:20:51 -0500
commitb6ec57f4b92e9bae4617f7d98a054d45370284bb (patch)
tree31b894dc2fa7c8a885baa4be7094c73002999719 /fs/proc
parent404a47410c26a115123885977053e9a1a4460929 (diff)
thp: change pmd_trans_huge_lock() interface to return ptl
After THP refcounting rework we have only two possible return values from pmd_trans_huge_lock(): success and failure. Return-by-pointer for ptl doesn't make much sense in this case. Let's convert pmd_trans_huge_lock() to return ptl on success and NULL on failure. Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Minchan Kim <minchan@kernel.org> Acked-by: Michal Hocko <mhocko@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/task_mmu.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 71ffc91060f6..85d16c67c33e 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -602,7 +602,8 @@ static int smaps_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
602 pte_t *pte; 602 pte_t *pte;
603 spinlock_t *ptl; 603 spinlock_t *ptl;
604 604
605 if (pmd_trans_huge_lock(pmd, vma, &ptl)) { 605 ptl = pmd_trans_huge_lock(pmd, vma);
606 if (ptl) {
606 smaps_pmd_entry(pmd, addr, walk); 607 smaps_pmd_entry(pmd, addr, walk);
607 spin_unlock(ptl); 608 spin_unlock(ptl);
608 return 0; 609 return 0;
@@ -913,7 +914,8 @@ static int clear_refs_pte_range(pmd_t *pmd, unsigned long addr,
913 spinlock_t *ptl; 914 spinlock_t *ptl;
914 struct page *page; 915 struct page *page;
915 916
916 if (pmd_trans_huge_lock(pmd, vma, &ptl)) { 917 ptl = pmd_trans_huge_lock(pmd, vma);
918 if (ptl) {
917 if (cp->type == CLEAR_REFS_SOFT_DIRTY) { 919 if (cp->type == CLEAR_REFS_SOFT_DIRTY) {
918 clear_soft_dirty_pmd(vma, addr, pmd); 920 clear_soft_dirty_pmd(vma, addr, pmd);
919 goto out; 921 goto out;
@@ -1187,7 +1189,8 @@ static int pagemap_pmd_range(pmd_t *pmdp, unsigned long addr, unsigned long end,
1187 int err = 0; 1189 int err = 0;
1188 1190
1189#ifdef CONFIG_TRANSPARENT_HUGEPAGE 1191#ifdef CONFIG_TRANSPARENT_HUGEPAGE
1190 if (pmd_trans_huge_lock(pmdp, vma, &ptl)) { 1192 ptl = pmd_trans_huge_lock(pmdp, vma);
1193 if (ptl) {
1191 u64 flags = 0, frame = 0; 1194 u64 flags = 0, frame = 0;
1192 pmd_t pmd = *pmdp; 1195 pmd_t pmd = *pmdp;
1193 1196
@@ -1519,7 +1522,8 @@ static int gather_pte_stats(pmd_t *pmd, unsigned long addr,
1519 pte_t *orig_pte; 1522 pte_t *orig_pte;
1520 pte_t *pte; 1523 pte_t *pte;
1521 1524
1522 if (pmd_trans_huge_lock(pmd, vma, &ptl)) { 1525 ptl = pmd_trans_huge_lock(pmd, vma);
1526 if (ptl) {
1523 pte_t huge_pte = *(pte_t *)pmd; 1527 pte_t huge_pte = *(pte_t *)pmd;
1524 struct page *page; 1528 struct page *page;
1525 1529