Skip to content

Commit

Permalink
mm: rename is_mlocked_vma() to mlocked_vma_newpage()
Browse files Browse the repository at this point in the history
Andrew pointed out that the is_mlocked_vma() is misnamed.  A function
with name like that would expect bool return and no side-effects.

Since it is called on the fault path for new page, rename it in this
patch.

Signed-off-by: Ying Han <[email protected]>
Reviewed-by: Rik van Riel <[email protected]>
Acked-by: KOSAKI Motohiro <[email protected]>
Acked-by: KAMEZAWA Hiroyuki <[email protected]>
Reviewed-by: Minchan Kim <[email protected]>
[[email protected]: s/mlock_vma_newpage/mlock_vma_newpage/, per Minchan]
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
yinghan authored and torvalds committed May 29, 2012
1 parent c3ac9a8 commit 096a7cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions mm/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ static inline void munlock_vma_pages_all(struct vm_area_struct *vma)
* to determine if it's being mapped into a LOCKED vma.
* If so, mark page as mlocked.
*/
static inline int is_mlocked_vma(struct vm_area_struct *vma, struct page *page)
static inline int mlocked_vma_newpage(struct vm_area_struct *vma,
struct page *page)
{
VM_BUG_ON(PageLRU(page));

Expand Down Expand Up @@ -222,7 +223,7 @@ extern unsigned long vma_address(struct page *page,
struct vm_area_struct *vma);
#endif
#else /* !CONFIG_MMU */
static inline int is_mlocked_vma(struct vm_area_struct *v, struct page *p)
static inline int mlocked_vma_newpage(struct vm_area_struct *v, struct page *p)
{
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -3321,7 +3321,7 @@ int page_evictable(struct page *page, struct vm_area_struct *vma)
if (mapping_unevictable(page_mapping(page)))
return 0;

if (PageMlocked(page) || (vma && is_mlocked_vma(vma, page)))
if (PageMlocked(page) || (vma && mlocked_vma_newpage(vma, page)))
return 0;

return 1;
Expand Down

0 comments on commit 096a7cf

Please sign in to comment.