diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2009-09-21 17:02:59 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 07:17:37 -0700 |
commit | 6c0b13519d1c755d874e82c8fb8a6dcef0ee402c (patch) | |
tree | 0fe6e6902a488ad6c59ecee971fe64c81edbcce3 /include | |
parent | 401a8e1c1670085b8177330ca47d4f7c4ac88761 (diff) | |
download | linux-3.10-6c0b13519d1c755d874e82c8fb8a6dcef0ee402c.tar.gz linux-3.10-6c0b13519d1c755d874e82c8fb8a6dcef0ee402c.tar.bz2 linux-3.10-6c0b13519d1c755d874e82c8fb8a6dcef0ee402c.zip |
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 'include')
-rw-r--r-- | include/linux/mm_inline.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 99977ff45b8..8835b877b8d 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h @@ -5,7 +5,7 @@ * page_is_file_cache - should the page be on a file LRU or anon LRU? * @page: the page to test * - * Returns LRU_FILE if @page is page cache page backed by a regular filesystem, + * Returns 1 if @page is page cache page backed by a regular filesystem, * or 0 if @page is anonymous, tmpfs or otherwise ram or swap backed. * Used by functions that manipulate the LRU lists, to sort a page * onto the right LRU list. @@ -16,11 +16,7 @@ */ static inline int page_is_file_cache(struct page *page) { - if (PageSwapBacked(page)) - return 0; - - /* The page is page cache backed by a normal filesystem. */ - return LRU_FILE; + return !PageSwapBacked(page); } static inline void |