aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJoonsoo Kim <iamjoonsoo.kim@lge.com>2014-01-21 18:49:48 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-21 19:19:45 -0500
commit051ac83adf69eea4f57a97356e4282e395a5fa6d (patch)
tree82961f46bc13e50e8a6aacad99dcd09c8df0ff4d /include
parentfaecd8dd852d4e4a63a1b8ad43e5df8e41ee0336 (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 'include')
-rw-r--r--include/linux/ksm.h7
-rw-r--r--include/linux/rmap.h9
2 files changed, 10 insertions, 6 deletions
diff --git a/include/linux/ksm.h b/include/linux/ksm.h
index 45c9b6a17bcb..0eef8cb0baf7 100644
--- a/include/linux/ksm.h
+++ b/include/linux/ksm.h
@@ -76,8 +76,7 @@ struct page *ksm_might_need_to_copy(struct page *page,
76int page_referenced_ksm(struct page *page, 76int page_referenced_ksm(struct page *page,
77 struct mem_cgroup *memcg, unsigned long *vm_flags); 77 struct mem_cgroup *memcg, unsigned long *vm_flags);
78int try_to_unmap_ksm(struct page *page, enum ttu_flags flags); 78int try_to_unmap_ksm(struct page *page, enum ttu_flags flags);
79int rmap_walk_ksm(struct page *page, int (*rmap_one)(struct page *, 79int rmap_walk_ksm(struct page *page, struct rmap_walk_control *rwc);
80 struct vm_area_struct *, unsigned long, void *), void *arg);
81void ksm_migrate_page(struct page *newpage, struct page *oldpage); 80void ksm_migrate_page(struct page *newpage, struct page *oldpage);
82 81
83#else /* !CONFIG_KSM */ 82#else /* !CONFIG_KSM */
@@ -120,8 +119,8 @@ static inline int try_to_unmap_ksm(struct page *page, enum ttu_flags flags)
120 return 0; 119 return 0;
121} 120}
122 121
123static inline int rmap_walk_ksm(struct page *page, int (*rmap_one)(struct page*, 122static inline int rmap_walk_ksm(struct page *page,
124 struct vm_area_struct *, unsigned long, void *), void *arg) 123 struct rmap_walk_control *rwc)
125{ 124{
126 return 0; 125 return 0;
127} 126}
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index 6dacb93a6d94..6a456ce6de20 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -235,11 +235,16 @@ struct anon_vma *page_lock_anon_vma_read(struct page *page);
235void page_unlock_anon_vma_read(struct anon_vma *anon_vma); 235void page_unlock_anon_vma_read(struct anon_vma *anon_vma);
236int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); 236int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma);
237 237
238struct rmap_walk_control {
239 void *arg;
240 int (*rmap_one)(struct page *page, struct vm_area_struct *vma,
241 unsigned long addr, void *arg);
242};
243
238/* 244/*
239 * Called by migrate.c to remove migration ptes, but might be used more later. 245 * Called by migrate.c to remove migration ptes, but might be used more later.
240 */ 246 */
241int rmap_walk(struct page *page, int (*rmap_one)(struct page *, 247int rmap_walk(struct page *page, struct rmap_walk_control *rwc);
242 struct vm_area_struct *, unsigned long, void *), void *arg);
243 248
244#else /* !CONFIG_MMU */ 249#else /* !CONFIG_MMU */
245 250