Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279880
b: refs/heads/master
c: be9b733
h: refs/heads/master
v: v3
  • Loading branch information
Nicolas Pitre authored and Nicolas Pitre committed Nov 18, 2011
1 parent 5b1acae commit 0499e78
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 55a8173cfe1c6b489f8f5705282c762aed2e265e
refs/heads/master: be9b7335e70696bee731c152429b1737e42fe163
1 change: 1 addition & 0 deletions trunk/include/linux/vmalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ extern long vwrite(char *buf, char *addr, unsigned long count);
*/
extern rwlock_t vmlist_lock;
extern struct vm_struct *vmlist;
extern __init void vm_area_add_early(struct vm_struct *vm);
extern __init void vm_area_register_early(struct vm_struct *vm, size_t align);

#ifdef CONFIG_SMP
Expand Down
29 changes: 27 additions & 2 deletions trunk/mm/vmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,32 @@ void *vm_map_ram(struct page **pages, unsigned int count, int node, pgprot_t pro
}
EXPORT_SYMBOL(vm_map_ram);

/**
* vm_area_add_early - add vmap area early during boot
* @vm: vm_struct to add
*
* This function is used to add fixed kernel vm area to vmlist before
* vmalloc_init() is called. @vm->addr, @vm->size, and @vm->flags
* should contain proper values and the other fields should be zero.
*
* DO NOT USE THIS FUNCTION UNLESS YOU KNOW WHAT YOU'RE DOING.
*/
void __init vm_area_add_early(struct vm_struct *vm)
{
struct vm_struct *tmp, **p;

BUG_ON(vmap_initialized);
for (p = &vmlist; (tmp = *p) != NULL; p = &tmp->next) {
if (tmp->addr >= vm->addr) {
BUG_ON(tmp->addr < vm->addr + vm->size);
break;
} else
BUG_ON(tmp->addr + tmp->size > vm->addr);
}
vm->next = *p;
*p = vm;
}

/**
* vm_area_register_early - register vmap area early during boot
* @vm: vm_struct to register
Expand All @@ -1139,8 +1165,7 @@ void __init vm_area_register_early(struct vm_struct *vm, size_t align)

vm->addr = (void *)addr;

vm->next = vmlist;
vmlist = vm;
vm_area_add_early(vm);
}

void __init vmalloc_init(void)
Expand Down

0 comments on commit 0499e78

Please sign in to comment.