Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277175
b: refs/heads/master
c: 7fb0bc3
h: refs/heads/master
i:
  277173: 1943a10
  277171: cf3aadf
  277167: fc713ef
v: v3
  • Loading branch information
Tejun Heo committed Dec 8, 2011
1 parent b9f0b4b commit 5a840cd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 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: 1aadc0560f46530f8a0f11055285b876a8a31770
refs/heads/master: 7fb0bc3f06fdc3a35e41bcea7a15e53d2515362f
1 change: 1 addition & 0 deletions trunk/include/linux/memblock.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ int memblock_free_reserved_regions(void);
int memblock_reserve_reserved_regions(void);

void memblock_allow_resize(void);
int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid);
int memblock_add(phys_addr_t base, phys_addr_t size);
int memblock_remove(phys_addr_t base, phys_addr_t size);
int memblock_free(phys_addr_t base, phys_addr_t size);
Expand Down
20 changes: 13 additions & 7 deletions trunk/mm/memblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ static void __init_memblock memblock_insert_region(struct memblock_type *type,
* @type: memblock type to add new region into
* @base: base address of the new region
* @size: size of the new region
* @nid: nid of the new region
*
* Add new memblock region [@base,@base+@size) into @type. The new region
* is allowed to overlap with existing ones - overlaps don't affect already
Expand All @@ -334,7 +335,7 @@ static void __init_memblock memblock_insert_region(struct memblock_type *type,
* 0 on success, -errno on failure.
*/
static int __init_memblock memblock_add_region(struct memblock_type *type,
phys_addr_t base, phys_addr_t size)
phys_addr_t base, phys_addr_t size, int nid)
{
bool insert = false;
phys_addr_t obase = base;
Expand All @@ -346,7 +347,7 @@ static int __init_memblock memblock_add_region(struct memblock_type *type,
WARN_ON(type->cnt != 1 || type->total_size);
type->regions[0].base = base;
type->regions[0].size = size;
memblock_set_region_node(&type->regions[0], MAX_NUMNODES);
memblock_set_region_node(&type->regions[0], nid);
type->total_size = size;
return 0;
}
Expand Down Expand Up @@ -376,7 +377,7 @@ static int __init_memblock memblock_add_region(struct memblock_type *type,
nr_new++;
if (insert)
memblock_insert_region(type, i++, base,
rbase - base, MAX_NUMNODES);
rbase - base, nid);
}
/* area below @rend is dealt with, forget about it */
base = min(rend, end);
Expand All @@ -386,8 +387,7 @@ static int __init_memblock memblock_add_region(struct memblock_type *type,
if (base < end) {
nr_new++;
if (insert)
memblock_insert_region(type, i, base, end - base,
MAX_NUMNODES);
memblock_insert_region(type, i, base, end - base, nid);
}

/*
Expand All @@ -406,9 +406,15 @@ static int __init_memblock memblock_add_region(struct memblock_type *type,
}
}

int __init_memblock memblock_add_node(phys_addr_t base, phys_addr_t size,
int nid)
{
return memblock_add_region(&memblock.memory, base, size, nid);
}

int __init_memblock memblock_add(phys_addr_t base, phys_addr_t size)
{
return memblock_add_region(&memblock.memory, base, size);
return memblock_add_region(&memblock.memory, base, size, MAX_NUMNODES);
}

/**
Expand Down Expand Up @@ -522,7 +528,7 @@ int __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size)
(void *)_RET_IP_);
BUG_ON(0 == size);

return memblock_add_region(_rgn, base, size);
return memblock_add_region(_rgn, base, size, MAX_NUMNODES);
}

/**
Expand Down

0 comments on commit 5a840cd

Please sign in to comment.