mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 22:51:37 +00:00
mm: return boolean from page_is_file_cache()
page_is_file_cache() has been used for both boolean checks and LRU arithmetic, which was always a bit weird. Now that page_lru_base_type() exists for LRU arithmetic, make page_is_file_cache() a real predicate function and adjust the boolean-using callsites to drop those pesky double negations. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
401a8e1c16
commit
6c0b13519d
4 changed files with 7 additions and 11 deletions
|
@ -68,7 +68,7 @@ int putback_lru_pages(struct list_head *l)
|
|||
list_for_each_entry_safe(page, page2, l, lru) {
|
||||
list_del(&page->lru);
|
||||
dec_zone_page_state(page, NR_ISOLATED_ANON +
|
||||
!!page_is_file_cache(page));
|
||||
page_is_file_cache(page));
|
||||
putback_lru_page(page);
|
||||
count++;
|
||||
}
|
||||
|
@ -701,7 +701,7 @@ unlock:
|
|||
*/
|
||||
list_del(&page->lru);
|
||||
dec_zone_page_state(page, NR_ISOLATED_ANON +
|
||||
!!page_is_file_cache(page));
|
||||
page_is_file_cache(page));
|
||||
putback_lru_page(page);
|
||||
}
|
||||
|
||||
|
@ -751,7 +751,7 @@ int migrate_pages(struct list_head *from,
|
|||
local_irq_save(flags);
|
||||
list_for_each_entry(page, from, lru)
|
||||
__inc_zone_page_state(page, NR_ISOLATED_ANON +
|
||||
!!page_is_file_cache(page));
|
||||
page_is_file_cache(page));
|
||||
local_irq_restore(flags);
|
||||
|
||||
if (!swapwrite)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue