mm/khugepaged: use vma_is_anonymous
Clean up the vma->vm_ops usage. Use vma_is_anonymous instead of vma->vm_ops to make it more understandable. Link: https://lkml.kernel.org/r/20220424071642.3234971-1-xu.xin16@zte.com.cn Signed-off-by: xu xin <xu.xin16@zte.com.cn> Reviewed-by: Yang Shi <shy828301@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Родитель
30a514002d
Коммит
25fa414ada
|
@ -466,7 +466,7 @@ static bool hugepage_vma_check(struct vm_area_struct *vma,
|
||||||
S_ISREG(inode->i_mode);
|
S_ISREG(inode->i_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!vma->anon_vma || vma->vm_ops)
|
if (!vma->anon_vma || !vma_is_anonymous(vma))
|
||||||
return false;
|
return false;
|
||||||
if (vma_is_temporary_stack(vma))
|
if (vma_is_temporary_stack(vma))
|
||||||
return false;
|
return false;
|
||||||
|
@ -972,7 +972,7 @@ static int hugepage_vma_revalidate(struct mm_struct *mm, unsigned long address,
|
||||||
if (!hugepage_vma_check(vma, vma->vm_flags))
|
if (!hugepage_vma_check(vma, vma->vm_flags))
|
||||||
return SCAN_VMA_CHECK;
|
return SCAN_VMA_CHECK;
|
||||||
/* Anon VMA expected */
|
/* Anon VMA expected */
|
||||||
if (!vma->anon_vma || vma->vm_ops)
|
if (!vma->anon_vma || !vma_is_anonymous(vma))
|
||||||
return SCAN_VMA_CHECK;
|
return SCAN_VMA_CHECK;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче