diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2009-09-21 20:02:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 10:17:37 -0400 |
commit | 6c0b13519d1c755d874e82c8fb8a6dcef0ee402c (patch) | |
tree | 0fe6e6902a488ad6c59ecee971fe64c81edbcce3 /mm/migrate.c | |
parent | 401a8e1c1670085b8177330ca47d4f7c4ac88761 (diff) |
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>
Diffstat (limited to 'mm/migrate.c')
-rw-r--r-- | mm/migrate.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/migrate.c b/mm/migrate.c index b535a2c1656c..e97e513fe898 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -68,7 +68,7 @@ int putback_lru_pages(struct list_head *l) | |||
68 | list_for_each_entry_safe(page, page2, l, lru) { | 68 | list_for_each_entry_safe(page, page2, l, lru) { |
69 | list_del(&page->lru); | 69 | list_del(&page->lru); |
70 | dec_zone_page_state(page, NR_ISOLATED_ANON + | 70 | dec_zone_page_state(page, NR_ISOLATED_ANON + |
71 | !!page_is_file_cache(page)); | 71 | page_is_file_cache(page)); |
72 | putback_lru_page(page); | 72 | putback_lru_page(page); |
73 | count++; | 73 | count++; |
74 | } | 74 | } |
@@ -701,7 +701,7 @@ unlock: | |||
701 | */ | 701 | */ |
702 | list_del(&page->lru); | 702 | list_del(&page->lru); |
703 | dec_zone_page_state(page, NR_ISOLATED_ANON + | 703 | dec_zone_page_state(page, NR_ISOLATED_ANON + |
704 | !!page_is_file_cache(page)); | 704 | page_is_file_cache(page)); |
705 | putback_lru_page(page); | 705 | putback_lru_page(page); |
706 | } | 706 | } |
707 | 707 | ||
@@ -751,7 +751,7 @@ int migrate_pages(struct list_head *from, | |||
751 | local_irq_save(flags); | 751 | local_irq_save(flags); |
752 | list_for_each_entry(page, from, lru) | 752 | list_for_each_entry(page, from, lru) |
753 | __inc_zone_page_state(page, NR_ISOLATED_ANON + | 753 | __inc_zone_page_state(page, NR_ISOLATED_ANON + |
754 | !!page_is_file_cache(page)); | 754 | page_is_file_cache(page)); |
755 | local_irq_restore(flags); | 755 | local_irq_restore(flags); |
756 | 756 | ||
757 | if (!swapwrite) | 757 | if (!swapwrite) |