summaryrefslogtreecommitdiff
path: root/include/linux/vmalloc.h
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2005-03-13 00:22:38 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-03-13 00:22:38 -0800
commit2c4942f99d8fc003f118b1237bb5bfb8f22ddfeb (patch)
tree9d6589abd0a21cf46e3bf1fa3b8cc2616d35ac64 /include/linux/vmalloc.h
parent5e0168c9f6137a0b6c1d58443d02d45c0e0ee2ae (diff)
[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 <oleg@tv-sign.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/vmalloc.h')
-rw-r--r--include/linux/vmalloc.h8
1 files changed, 4 insertions, 4 deletions
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 <linux/spinlock.h>
+#include <linux/list.h>
#include <asm/page.h> /* 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);
/*