aboutsummaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorAlexandru Moise <00moses.alexander00@gmail.com>2015-11-05 21:48:08 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-05 22:34:48 -0500
commitd031a157915e0508ffa1ab9f1bbf977257529cb4 (patch)
tree7b983910489c58b1545845622a301e154ad008d8 /mm/vmscan.c
parentda39da3a54fed88e29024f2f1f6cd7357cd03a44 (diff)
mm/vmscan.c: fix types of some locals
In zone_reclaimable_pages(), `nr' is returned by a function which is declared as returning "unsigned long", so declare it such. Negative values are meaningless here. In zone_pagecache_reclaimable() we should also declare `delta' and `nr_pagecache_reclaimable' as being unsigned longs because they're used to store the values returned by zone_page_state() and zone_unmapped_file_pages() which also happen to return unsigned integers. [akpm@linux-foundation.org: make zone_pagecache_reclaimable() return ulong rather than long] Signed-off-by: Alexandru Moise <00moses.alexander00@gmail.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Vladimir Davydov <vdavydov@parallels.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Mel Gorman <mgorman@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 38d04810e0ee..fdd89978d083 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -194,7 +194,7 @@ static bool sane_reclaim(struct scan_control *sc)
194 194
195static unsigned long zone_reclaimable_pages(struct zone *zone) 195static unsigned long zone_reclaimable_pages(struct zone *zone)
196{ 196{
197 int nr; 197 unsigned long nr;
198 198
199 nr = zone_page_state(zone, NR_ACTIVE_FILE) + 199 nr = zone_page_state(zone, NR_ACTIVE_FILE) +
200 zone_page_state(zone, NR_INACTIVE_FILE); 200 zone_page_state(zone, NR_INACTIVE_FILE);
@@ -3693,10 +3693,10 @@ static inline unsigned long zone_unmapped_file_pages(struct zone *zone)
3693} 3693}
3694 3694
3695/* Work out how many page cache pages we can reclaim in this reclaim_mode */ 3695/* Work out how many page cache pages we can reclaim in this reclaim_mode */
3696static long zone_pagecache_reclaimable(struct zone *zone) 3696static unsigned long zone_pagecache_reclaimable(struct zone *zone)
3697{ 3697{
3698 long nr_pagecache_reclaimable; 3698 unsigned long nr_pagecache_reclaimable;
3699 long delta = 0; 3699 unsigned long delta = 0;
3700 3700
3701 /* 3701 /*
3702 * If RECLAIM_UNMAP is set, then all file pages are considered 3702 * If RECLAIM_UNMAP is set, then all file pages are considered