aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2005-01-04 05:25:12 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-04 05:25:12 -0800
commit6c0993a01c43e614a7865da5c6f10894bff9e9b9 (patch)
tree83f2514d35630f029e8f7d77b307128bbd157be6 /mm
parentf5f20ef06a07cd9f51ba99094cd88bee47bc58d2 (diff)
downloadhistory-6c0993a01c43e614a7865da5c6f10894bff9e9b9.tar.gz
[PATCH] Cross-reference nommu VMAs with mappings
The attached patch includes prio-tree support and adds cross-referencing of VMAs with address spaces back in, as is done under normal MMU Linux. Signed-Off-By: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/Makefile4
-rw-r--r--mm/nommu.c22
2 files changed, 20 insertions, 6 deletions
diff --git a/mm/Makefile b/mm/Makefile
index 4fb15e11539578..097408064f6a3d 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -5,12 +5,12 @@
mmu-y := nommu.o
mmu-$(CONFIG_MMU) := fremap.o highmem.o madvise.o memory.o mincore.o \
mlock.o mmap.o mprotect.o mremap.o msync.o rmap.o \
- vmalloc.o prio_tree.o
+ vmalloc.o
obj-y := bootmem.o filemap.o mempool.o oom_kill.o fadvise.o \
page_alloc.o page-writeback.o pdflush.o \
readahead.o slab.o swap.o truncate.o vmscan.o \
- $(mmu-y)
+ prio_tree.o $(mmu-y)
obj-$(CONFIG_SWAP) += page_io.o swap_state.o swapfile.o thrash.o
obj-$(CONFIG_HUGETLBFS) += hugetlb.o
diff --git a/mm/nommu.c b/mm/nommu.c
index 5d3d8136a08cb7..7ee66abb00bc1b 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -51,10 +51,6 @@ DECLARE_RWSEM(nommu_vma_sem);
struct vm_operations_struct generic_file_vm_ops = {
};
-void __init prio_tree_init(void)
-{
-}
-
/*
* Handle all mappings that got truncated by a "truncate()"
* system call.
@@ -322,6 +318,15 @@ static void add_nommu_vma(struct vm_area_struct *vma)
struct rb_node **p = &nommu_vma_tree.rb_node;
struct rb_node *parent = NULL;
+ /* add the VMA to the mapping */
+ if (vma->vm_file) {
+ mapping = vma->vm_file->f_mapping;
+
+ flush_dcache_mmap_lock(mapping);
+ vma_prio_tree_insert(vma, &mapping->i_mmap);
+ flush_dcache_mmap_unlock(mapping);
+ }
+
/* add the VMA to the master list */
while (*p) {
parent = *p;
@@ -356,6 +361,15 @@ static void delete_nommu_vma(struct vm_area_struct *vma)
{
struct address_space *mapping;
+ /* remove the VMA from the mapping */
+ if (vma->vm_file) {
+ mapping = vma->vm_file->f_mapping;
+
+ flush_dcache_mmap_lock(mapping);
+ vma_prio_tree_remove(vma, &mapping->i_mmap);
+ flush_dcache_mmap_unlock(mapping);
+ }
+
/* remove from the master list */
rb_erase(&vma->vm_rb, &nommu_vma_tree);
}