提交 4ee815be 编写于 作者: Y Yaowei Bai 提交者: Linus Torvalds

mm/mempolicy.c: vma_migratable() can return bool

Make vma_migratable() return bool due to this particular function only
using either one or zero as its return value.
Signed-off-by: NYaowei Bai <baiyaowei@cmss.chinamobile.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 bb00a789
...@@ -172,14 +172,14 @@ extern int mpol_parse_str(char *str, struct mempolicy **mpol); ...@@ -172,14 +172,14 @@ extern int mpol_parse_str(char *str, struct mempolicy **mpol);
extern void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol); extern void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol);
/* Check if a vma is migratable */ /* Check if a vma is migratable */
static inline int vma_migratable(struct vm_area_struct *vma) static inline bool vma_migratable(struct vm_area_struct *vma)
{ {
if (vma->vm_flags & (VM_IO | VM_PFNMAP)) if (vma->vm_flags & (VM_IO | VM_PFNMAP))
return 0; return false;
#ifndef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION #ifndef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION
if (vma->vm_flags & VM_HUGETLB) if (vma->vm_flags & VM_HUGETLB)
return 0; return false;
#endif #endif
/* /*
...@@ -190,8 +190,8 @@ static inline int vma_migratable(struct vm_area_struct *vma) ...@@ -190,8 +190,8 @@ static inline int vma_migratable(struct vm_area_struct *vma)
if (vma->vm_file && if (vma->vm_file &&
gfp_zone(mapping_gfp_mask(vma->vm_file->f_mapping)) gfp_zone(mapping_gfp_mask(vma->vm_file->f_mapping))
< policy_zone) < policy_zone)
return 0; return false;
return 1; return true;
} }
extern int mpol_misplaced(struct page *, struct vm_area_struct *, unsigned long); extern int mpol_misplaced(struct page *, struct vm_area_struct *, unsigned long);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册