From 2c4942f99d8fc003f118b1237bb5bfb8f22ddfeb Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Sun, 13 Mar 2005 00:22:38 -0800 Subject: [PATCH] vmalloc: use list of pages instead of array in vm_struct This patch assumes that there is no valid usage of vmalloced_or_vmaped_page->lru. In such a case vm_struct->array could be eliminated. It saves some memory and simplifies code a bit. In vmap/vunmap case vm_struct->page_list is used only in map_vm_area(), so it is ok to do: addr1 = vmap(pages, count); addr2 = vmap(pages, count); ... vunmap(addr1); vunmap(addr2); Signed-off-by: Oleg Nesterov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/vmalloc.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/linux') diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 968227f79508..4f6f6de8702d 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -2,6 +2,7 @@ #define _LINUX_VMALLOC_H #include +#include #include /* pgprot_t */ /* bits in vm_struct->flags */ @@ -14,8 +15,7 @@ struct vm_struct { void *addr; unsigned long size; unsigned long flags; - struct page **pages; - unsigned int nr_pages; + struct list_head page_list; unsigned long phys_addr; struct vm_struct *next; }; @@ -30,6 +30,7 @@ extern void *__vmalloc(unsigned long size, int gfp_mask, pgprot_t prot); extern void *__vmalloc_area(struct vm_struct *area, int gfp_mask, pgprot_t prot); extern void vfree(void *addr); +struct page; extern void *vmap(struct page **pages, unsigned int count, unsigned long flags, pgprot_t prot); extern void vunmap(void *addr); @@ -41,8 +42,7 @@ extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, unsigned long start, unsigned long end); extern struct vm_struct *remove_vm_area(void *addr); -extern int map_vm_area(struct vm_struct *area, pgprot_t prot, - struct page ***pages); +extern int map_vm_area(struct vm_struct *area, pgprot_t prot); extern void unmap_vm_area(struct vm_struct *area); /* -- cgit v1.2.3