diff options
author | Minchan Kim <minchan@kernel.org> | 2017-05-03 17:54:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-05-03 18:52:10 -0400 |
commit | 666e5a406c3ed562e7b3ceff8b631b6067bdaead (patch) | |
tree | 7c92e65829e730413ae3e8afece9269004d5324f /mm/rmap.c | |
parent | 33fc80e2574737e6e21eecc4c1d7942370a2c752 (diff) |
mm: make ttu's return boolean
try_to_unmap() returns SWAP_SUCCESS or SWAP_FAIL so it's suitable for
boolean return. This patch changes it.
Link: http://lkml.kernel.org/r/1489555493-14659-8-git-send-email-minchan@kernel.org
Signed-off-by: Minchan Kim <minchan@kernel.org>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/rmap.c')
-rw-r--r-- | mm/rmap.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -1501,12 +1501,10 @@ static int page_mapcount_is_zero(struct page *page) | |||
1501 | * | 1501 | * |
1502 | * Tries to remove all the page table entries which are mapping this | 1502 | * Tries to remove all the page table entries which are mapping this |
1503 | * page, used in the pageout path. Caller must hold the page lock. | 1503 | * page, used in the pageout path. Caller must hold the page lock. |
1504 | * Return values are: | ||
1505 | * | 1504 | * |
1506 | * SWAP_SUCCESS - we succeeded in removing all mappings | 1505 | * If unmap is successful, return true. Otherwise, false. |
1507 | * SWAP_FAIL - the page is unswappable | ||
1508 | */ | 1506 | */ |
1509 | int try_to_unmap(struct page *page, enum ttu_flags flags) | 1507 | bool try_to_unmap(struct page *page, enum ttu_flags flags) |
1510 | { | 1508 | { |
1511 | struct rmap_walk_control rwc = { | 1509 | struct rmap_walk_control rwc = { |
1512 | .rmap_one = try_to_unmap_one, | 1510 | .rmap_one = try_to_unmap_one, |
@@ -1531,7 +1529,7 @@ int try_to_unmap(struct page *page, enum ttu_flags flags) | |||
1531 | else | 1529 | else |
1532 | rmap_walk(page, &rwc); | 1530 | rmap_walk(page, &rwc); |
1533 | 1531 | ||
1534 | return !page_mapcount(page) ? SWAP_SUCCESS : SWAP_FAIL; | 1532 | return !page_mapcount(page) ? true : false; |
1535 | } | 1533 | } |
1536 | 1534 | ||
1537 | static int page_not_mapped(struct page *page) | 1535 | static int page_not_mapped(struct page *page) |