[PATCH] Implement nommu find_vma()
From: David Howells
Date: Wed Dec 15 2004 - 09:24:05 EST
The attached patch implements a nommu version of find_vma().
Signed-Off-By: David Howells <dhowells@xxxxxxxxxx>
---
warthog>diffstat nommu-findvma-2610rc3.diff
nommu.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletion(-)
diff -uNrp linux-2.6.10-rc3-mm1-base/mm/nommu.c linux-2.6.10-rc3-mm1-nommu-rb/mm/nommu.c
--- linux-2.6.10-rc3-mm1-base/mm/nommu.c 2004-12-13 17:34:22.000000000 +0000
+++ linux-2.6.10-rc3-mm1-nommu-rb/mm/nommu.c 2004-12-15 13:38:04.036799411 +0000
@@ -793,11 +793,22 @@ unsigned long do_mremap(unsigned long ad
return vml->vma->vm_start;
}
-struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr)
+/*
+ * Look up the first VMA which satisfies addr < vm_end, NULL if none
+ */
+struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)
{
+ struct vm_list_struct *vml;
+
+ for (vml = mm->context.vmlist; vml; vml = vml->next)
+ if (addr >= vml->vma->vm_start && addr < vml->vma->vm_end)
+ return vml->vma;
+
return NULL;
}
+EXPORT_SYMBOL(find_vma);
+
struct page * follow_page(struct mm_struct *mm, unsigned long addr, int write)
{
return NULL;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/