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>
This commit is contained in:
parent
faecd8dd85
commit
051ac83adf
5 changed files with 27 additions and 21 deletions
|
@ -235,11 +235,16 @@ struct anon_vma *page_lock_anon_vma_read(struct page *page);
|
|||
void page_unlock_anon_vma_read(struct anon_vma *anon_vma);
|
||||
int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma);
|
||||
|
||||
struct rmap_walk_control {
|
||||
void *arg;
|
||||
int (*rmap_one)(struct page *page, struct vm_area_struct *vma,
|
||||
unsigned long addr, void *arg);
|
||||
};
|
||||
|
||||
/*
|
||||
* Called by migrate.c to remove migration ptes, but might be used more later.
|
||||
*/
|
||||
int rmap_walk(struct page *page, int (*rmap_one)(struct page *,
|
||||
struct vm_area_struct *, unsigned long, void *), void *arg);
|
||||
int rmap_walk(struct page *page, struct rmap_walk_control *rwc);
|
||||
|
||||
#else /* !CONFIG_MMU */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue