diff options
author | Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | 2015-09-09 18:39:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-10 16:29:01 -0400 |
commit | fb6dd5fa4165c4b82f1a11416c2fc192ae3a84e2 (patch) | |
tree | 0dae4e152583f047de37f625e6e1af9d51a40841 /mm | |
parent | 6dc296e7df4c9a0857491cc3f55da16a9eeeeae7 (diff) |
mm: use vma_is_anonymous() in create_huge_pmd() and wp_huge_pmd()
Let's use helper rather than direct check of vma->vm_ops to distinguish
anonymous VMA.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memory.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/memory.c b/mm/memory.c index 6cd0b2160401..9cb27470fee9 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -3233,7 +3233,7 @@ out: | |||
3233 | static int create_huge_pmd(struct mm_struct *mm, struct vm_area_struct *vma, | 3233 | static int create_huge_pmd(struct mm_struct *mm, struct vm_area_struct *vma, |
3234 | unsigned long address, pmd_t *pmd, unsigned int flags) | 3234 | unsigned long address, pmd_t *pmd, unsigned int flags) |
3235 | { | 3235 | { |
3236 | if (!vma->vm_ops) | 3236 | if (vma_is_anonymous(vma)) |
3237 | return do_huge_pmd_anonymous_page(mm, vma, address, pmd, flags); | 3237 | return do_huge_pmd_anonymous_page(mm, vma, address, pmd, flags); |
3238 | if (vma->vm_ops->pmd_fault) | 3238 | if (vma->vm_ops->pmd_fault) |
3239 | return vma->vm_ops->pmd_fault(vma, address, pmd, flags); | 3239 | return vma->vm_ops->pmd_fault(vma, address, pmd, flags); |
@@ -3244,7 +3244,7 @@ static int wp_huge_pmd(struct mm_struct *mm, struct vm_area_struct *vma, | |||
3244 | unsigned long address, pmd_t *pmd, pmd_t orig_pmd, | 3244 | unsigned long address, pmd_t *pmd, pmd_t orig_pmd, |
3245 | unsigned int flags) | 3245 | unsigned int flags) |
3246 | { | 3246 | { |
3247 | if (!vma->vm_ops) | 3247 | if (vma_is_anonymous(vma)) |
3248 | return do_huge_pmd_wp_page(mm, vma, address, pmd, orig_pmd); | 3248 | return do_huge_pmd_wp_page(mm, vma, address, pmd, orig_pmd); |
3249 | if (vma->vm_ops->pmd_fault) | 3249 | if (vma->vm_ops->pmd_fault) |
3250 | return vma->vm_ops->pmd_fault(vma, address, pmd, flags); | 3250 | return vma->vm_ops->pmd_fault(vma, address, pmd, flags); |