Commit d031a157 authored by Alexandru Moise's avatar Alexandru Moise Committed by Linus Torvalds

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: default avatarAlexandru Moise <00moses.alexander00@gmail.com>
Acked-by: default avatarMichal 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent da39da3a
...@@ -194,7 +194,7 @@ static bool sane_reclaim(struct scan_control *sc) ...@@ -194,7 +194,7 @@ static bool sane_reclaim(struct scan_control *sc)
static unsigned long zone_reclaimable_pages(struct zone *zone) static unsigned long zone_reclaimable_pages(struct zone *zone)
{ {
int nr; unsigned long nr;
nr = zone_page_state(zone, NR_ACTIVE_FILE) + nr = zone_page_state(zone, NR_ACTIVE_FILE) +
zone_page_state(zone, NR_INACTIVE_FILE); zone_page_state(zone, NR_INACTIVE_FILE);
...@@ -3693,10 +3693,10 @@ static inline unsigned long zone_unmapped_file_pages(struct zone *zone) ...@@ -3693,10 +3693,10 @@ static inline unsigned long zone_unmapped_file_pages(struct zone *zone)
} }
/* Work out how many page cache pages we can reclaim in this reclaim_mode */ /* Work out how many page cache pages we can reclaim in this reclaim_mode */
static long zone_pagecache_reclaimable(struct zone *zone) static unsigned long zone_pagecache_reclaimable(struct zone *zone)
{ {
long nr_pagecache_reclaimable; unsigned long nr_pagecache_reclaimable;
long delta = 0; unsigned long delta = 0;
/* /*
* If RECLAIM_UNMAP is set, then all file pages are considered * If RECLAIM_UNMAP is set, then all file pages are considered
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment