Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40397
b: refs/heads/master
c: 52fd24c
h: refs/heads/master
i:
  40395: 2e4f556
v: v3
  • Loading branch information
Giridhar Pemmasani authored and Linus Torvalds committed Oct 28, 2006
1 parent e1be362 commit f52ab51
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 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: 6a2aae06cc1e87e9712a26a639f6a2f3442e2027
refs/heads/master: 52fd24ca1db3a741f144bbc229beefe044202cac
3 changes: 2 additions & 1 deletion trunk/include/linux/vmalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ 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 *get_vm_area_node(unsigned long size,
unsigned long flags, int node);
unsigned long flags, int node,
gfp_t gfp_mask);
extern struct vm_struct *remove_vm_area(void *addr);
extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
struct page ***pages);
Expand Down
18 changes: 11 additions & 7 deletions trunk/mm/vmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,15 @@ int map_vm_area(struct vm_struct *area, pgprot_t prot, struct page ***pages)
return err;
}

struct vm_struct *__get_vm_area_node(unsigned long size, unsigned long flags,
unsigned long start, unsigned long end, int node)
static struct vm_struct *__get_vm_area_node(unsigned long size, unsigned long flags,
unsigned long start, unsigned long end,
int node, gfp_t gfp_mask)
{
struct vm_struct **p, *tmp, *area;
unsigned long align = 1;
unsigned long addr;

BUG_ON(in_interrupt());
if (flags & VM_IOREMAP) {
int bit = fls(size);

Expand All @@ -180,7 +182,7 @@ struct vm_struct *__get_vm_area_node(unsigned long size, unsigned long flags,
addr = ALIGN(start, align);
size = PAGE_ALIGN(size);

area = kmalloc_node(sizeof(*area), GFP_KERNEL, node);
area = kmalloc_node(sizeof(*area), gfp_mask, node);
if (unlikely(!area))
return NULL;

Expand Down Expand Up @@ -236,7 +238,7 @@ struct vm_struct *__get_vm_area_node(unsigned long size, unsigned long flags,
struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags,
unsigned long start, unsigned long end)
{
return __get_vm_area_node(size, flags, start, end, -1);
return __get_vm_area_node(size, flags, start, end, -1, GFP_KERNEL);
}

/**
Expand All @@ -253,9 +255,11 @@ struct vm_struct *get_vm_area(unsigned long size, unsigned long flags)
return __get_vm_area(size, flags, VMALLOC_START, VMALLOC_END);
}

struct vm_struct *get_vm_area_node(unsigned long size, unsigned long flags, int node)
struct vm_struct *get_vm_area_node(unsigned long size, unsigned long flags,
int node, gfp_t gfp_mask)
{
return __get_vm_area_node(size, flags, VMALLOC_START, VMALLOC_END, node);
return __get_vm_area_node(size, flags, VMALLOC_START, VMALLOC_END, node,
gfp_mask);
}

/* Caller must hold vmlist_lock */
Expand Down Expand Up @@ -487,7 +491,7 @@ static void *__vmalloc_node(unsigned long size, gfp_t gfp_mask, pgprot_t prot,
if (!size || (size >> PAGE_SHIFT) > num_physpages)
return NULL;

area = get_vm_area_node(size, VM_ALLOC, node);
area = get_vm_area_node(size, VM_ALLOC, node, gfp_mask);
if (!area)
return NULL;

Expand Down

0 comments on commit f52ab51

Please sign in to comment.