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 | |
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')
-rw-r--r-- | mm/migrate.c | 6 | ||||
-rw-r--r-- | mm/swap.c | 2 | ||||
-rw-r--r-- | mm/vmscan.c | 2 |
3 files changed, 5 insertions, 5 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) |
@@ -189,7 +189,7 @@ void activate_page(struct page *page) | |||
189 | add_page_to_lru_list(zone, page, lru); | 189 | add_page_to_lru_list(zone, page, lru); |
190 | __count_vm_event(PGACTIVATE); | 190 | __count_vm_event(PGACTIVATE); |
191 | 191 | ||
192 | update_page_reclaim_stat(zone, page, !!file, 1); | 192 | update_page_reclaim_stat(zone, page, file, 1); |
193 | } | 193 | } |
194 | spin_unlock_irq(&zone->lru_lock); | 194 | spin_unlock_irq(&zone->lru_lock); |
195 | } | 195 | } |
diff --git a/mm/vmscan.c b/mm/vmscan.c index 30e56ee833f8..172119caebcc 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -821,7 +821,7 @@ int __isolate_lru_page(struct page *page, int mode, int file) | |||
821 | if (mode != ISOLATE_BOTH && (!PageActive(page) != !mode)) | 821 | if (mode != ISOLATE_BOTH && (!PageActive(page) != !mode)) |
822 | return ret; | 822 | return ret; |
823 | 823 | ||
824 | if (mode != ISOLATE_BOTH && (!page_is_file_cache(page) != !file)) | 824 | if (mode != ISOLATE_BOTH && page_is_file_cache(page) != file) |
825 | return ret; | 825 | return ret; |
826 | 826 | ||
827 | /* | 827 | /* |