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:
Johannes Weiner 2009-09-21 17:02:59 -07:00 committed by Linus Torvalds
parent 401a8e1c16
commit 6c0b13519d
4 changed files with 7 additions and 11 deletions

View file

@ -821,7 +821,7 @@ int __isolate_lru_page(struct page *page, int mode, int file)
if (mode != ISOLATE_BOTH && (!PageActive(page) != !mode))
return ret;
if (mode != ISOLATE_BOTH && (!page_is_file_cache(page) != !file))
if (mode != ISOLATE_BOTH && page_is_file_cache(page) != file)
return ret;
/*