From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756851AbbGQLxh (ORCPT ); Fri, 17 Jul 2015 07:53:37 -0400 Received: from mga01.intel.com ([192.55.52.88]:17693 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753275AbbGQLx0 (ORCPT ); Fri, 17 Jul 2015 07:53:26 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,495,1432623600"; d="scan'208";a="764471837" From: "Kirill A. Shutemov" To: Andrew Morton Cc: Oleg Nesterov , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" Subject: [PATCHv2 5/6] mm: use vma_is_anonymous() in create_huge_pmd() and wp_huge_pmd() Date: Fri, 17 Jul 2015 14:53:12 +0300 Message-Id: <1437133993-91885-6-git-send-email-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1437133993-91885-1-git-send-email-kirill.shutemov@linux.intel.com> References: <1437133993-91885-1-git-send-email-kirill.shutemov@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Let's use helper rather than direct check of vma->vm_ops to distinguish anonymous VMA. Signed-off-by: Kirill A. Shutemov --- mm/memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index c70252ca9ef9..1c139aa94aff 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3235,7 +3235,7 @@ out: static int create_huge_pmd(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, pmd_t *pmd, unsigned int flags) { - if (!vma->vm_ops) + if (vma_is_anonymous(vma)) return do_huge_pmd_anonymous_page(mm, vma, address, pmd, flags); if (vma->vm_ops->pmd_fault) return vma->vm_ops->pmd_fault(vma, address, pmd, flags); @@ -3246,7 +3246,7 @@ static int wp_huge_pmd(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, pmd_t *pmd, pmd_t orig_pmd, unsigned int flags) { - if (!vma->vm_ops) + if (vma_is_anonymous(vma)) return do_huge_pmd_wp_page(mm, vma, address, pmd, orig_pmd); if (vma->vm_ops->pmd_fault) return vma->vm_ops->pmd_fault(vma, address, pmd, flags); -- 2.1.4