aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2007-05-06 17:48:54 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 15:12:51 -0400
commitaee16b3cee2746880e40945a9b5bff4f309cfbc4 (patch)
tree887faaebf5562dc1fac5e090140da04dc7e2a174 /include
parenteb3a1e1145ca8f12372c7c96aa0702d86a9002a9 (diff)
Add apply_to_page_range() which applies a function to a pte range
Add a new mm function apply_to_page_range() which applies a given function to every pte in a given virtual address range in a given mm structure. This is a generic alternative to cut-and-pasting the Linux idiomatic pagetable walking code in every place that a sequence of PTEs must be accessed. Although this interface is intended to be useful in a wide range of situations, it is currently used specifically by several Xen subsystems, for example: to ensure that pagetables have been allocated for a virtual address range, and to construct batched special pagetable update requests to map I/O memory (in ioremap()). [akpm@linux-foundation.org: fix warning, unpleasantly] Signed-off-by: Ian Pratt <ian.pratt@xensource.com> Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk> Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com> Cc: Christoph Lameter <clameter@sgi.com> Cc: Matt Mackall <mpm@waste.org> Acked-by: Ingo Molnar <mingo@elte.hu> 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/mm.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 60e0e4a592d2..7bf0bd882fc3 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1130,6 +1130,11 @@ struct page *follow_page(struct vm_area_struct *, unsigned long address,
1130#define FOLL_GET 0x04 /* do get_page on page */ 1130#define FOLL_GET 0x04 /* do get_page on page */
1131#define FOLL_ANON 0x08 /* give ZERO_PAGE if no pgtable */ 1131#define FOLL_ANON 0x08 /* give ZERO_PAGE if no pgtable */
1132 1132
1133typedef int (*pte_fn_t)(pte_t *pte, struct page *pmd_page, unsigned long addr,
1134 void *data);
1135extern int apply_to_page_range(struct mm_struct *mm, unsigned long address,
1136 unsigned long size, pte_fn_t fn, void *data);
1137
1133#ifdef CONFIG_PROC_FS 1138#ifdef CONFIG_PROC_FS
1134void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long); 1139void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long);
1135#else 1140#else