Commit b683effb authored by David Howells's avatar David Howells Committed by Linus Torvalds

[PATCH] Further nommu changes

The attached patch further changes the nommu stuff previously changed. These
new changes do the following:

 (0) Some additional variables have been defined to make nommu even compile.

 (1) Get rid of the alternate vm_area_struct. The nommu mmap now uses the
     normal one. There's a refcount field added to the normal one, contingent
     on !CONFIG_MMU.

 (2) vm_rb is now used to keep track of the VMAs in an rbtree rather than
     adding a separate list.

 (3) mm_tblock_struct is now vm_list_struct.

 (4) put_vma() now calls vma->vm_ops->close() if available on nommu.

 (5) A dummy generic_file_vm_ops has been provided. It does nothing, but
     permits tiny-shmem to compile.

     tiny-shmem and ramfs still need attention, such that files contained
     therein can be mmapped shared-writably to some extent on nommu.
Signed-Off-By: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 17c9f1a2
......@@ -58,7 +58,6 @@ extern int sysctl_legacy_va_layout;
* space that has a special rule for the page-fault handlers (ie a shared
* library, the executable area etc).
*/
#ifdef CONFIG_MMU
struct vm_area_struct {
struct mm_struct * vm_mm; /* The address space we belong to. */
unsigned long vm_start; /* Our start address within vm_mm. */
......@@ -107,34 +106,29 @@ struct vm_area_struct {
struct file * vm_file; /* File we map to (can be NULL). */
void * vm_private_data; /* was vm_pte (shared mem) */
#ifndef CONFIG_MMU
atomic_t vm_usage; /* refcount (VMAs shared if !MMU) */
#endif
#ifdef CONFIG_NUMA
struct mempolicy *vm_policy; /* NUMA policy for the VMA */
#endif
};
#else
struct vm_area_struct {
struct list_head vm_link; /* system object list */
atomic_t vm_usage; /* count of refs */
unsigned long vm_start;
unsigned long vm_end;
pgprot_t vm_page_prot; /* access permissions of this VMA */
unsigned long vm_flags;
unsigned long vm_pgoff;
struct file *vm_file; /* file or device mapped */
};
struct mm_tblock_struct {
struct mm_tblock_struct *next;
/*
* This struct defines the per-mm list of VMAs for uClinux. If CONFIG_MMU is
* disabled, then there's a single shared list of VMAs maintained by the
* system, and mm's subscribe to these individually
*/
struct vm_list_struct {
struct vm_list_struct *next;
struct vm_area_struct *vma;
};
extern struct list_head nommu_vma_list;
#ifndef CONFIG_MMU
extern struct rb_root nommu_vma_tree;
extern struct rw_semaphore nommu_vma_sem;
extern unsigned int kobjsize(const void *objp);
#endif
/*
......
This diff is collapsed.
......@@ -112,9 +112,7 @@ int shmem_zero_setup(struct vm_area_struct *vma)
if (vma->vm_file)
fput(vma->vm_file);
vma->vm_file = file;
#ifdef CONFIG_MMU
vma->vm_ops = &generic_file_vm_ops;
#endif
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment