diff options
author | Joonsoo Kim <iamjoonsoo.kim@lge.com> | 2014-01-21 18:49:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-21 19:19:45 -0500 |
commit | 051ac83adf69eea4f57a97356e4282e395a5fa6d (patch) | |
tree | 82961f46bc13e50e8a6aacad99dcd09c8df0ff4d /mm/ksm.c | |
parent | faecd8dd852d4e4a63a1b8ad43e5df8e41ee0336 (diff) |
mm/rmap: make rmap_walk to get the rmap_walk_control argument
In each rmap traverse case, there is some difference so that we need
function pointers and arguments to them in order to handle these
For this purpose, struct rmap_walk_control is introduced in this patch,
and will be extended in following patch. Introducing and extending are
separate, because it clarify changes.
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/ksm.c')
-rw-r--r-- | mm/ksm.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1997,8 +1997,7 @@ out: | |||
1997 | } | 1997 | } |
1998 | 1998 | ||
1999 | #ifdef CONFIG_MIGRATION | 1999 | #ifdef CONFIG_MIGRATION |
2000 | int rmap_walk_ksm(struct page *page, int (*rmap_one)(struct page *, | 2000 | int rmap_walk_ksm(struct page *page, struct rmap_walk_control *rwc) |
2001 | struct vm_area_struct *, unsigned long, void *), void *arg) | ||
2002 | { | 2001 | { |
2003 | struct stable_node *stable_node; | 2002 | struct stable_node *stable_node; |
2004 | struct rmap_item *rmap_item; | 2003 | struct rmap_item *rmap_item; |
@@ -2033,7 +2032,8 @@ again: | |||
2033 | if ((rmap_item->mm == vma->vm_mm) == search_new_forks) | 2032 | if ((rmap_item->mm == vma->vm_mm) == search_new_forks) |
2034 | continue; | 2033 | continue; |
2035 | 2034 | ||
2036 | ret = rmap_one(page, vma, rmap_item->address, arg); | 2035 | ret = rwc->rmap_one(page, vma, |
2036 | rmap_item->address, rwc->arg); | ||
2037 | if (ret != SWAP_AGAIN) { | 2037 | if (ret != SWAP_AGAIN) { |
2038 | anon_vma_unlock_read(anon_vma); | 2038 | anon_vma_unlock_read(anon_vma); |
2039 | goto out; | 2039 | goto out; |