memblock: Separate memblock_alloc_nid() and memblock_alloc_try_nid()
The former is now strict, it will fail if it cannot honor the allocation within the node, while the later implements the previous semantic which falls back to allocating anywhere. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
@@ -537,9 +537,23 @@ phys_addr_t __init memblock_alloc_nid(phys_addr_t size, phys_addr_t align, int n
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
phys_addr_t __init memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, int nid)
|
||||
{
|
||||
phys_addr_t res = memblock_alloc_nid(size, align, nid);
|
||||
|
||||
if (res)
|
||||
return res;
|
||||
return memblock_alloc(size, align);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Remaining API functions
|
||||
*/
|
||||
|
||||
/* You must call memblock_analyze() before this. */
|
||||
phys_addr_t __init memblock_phys_mem_size(void)
|
||||
{
|
||||
|
Reference in New Issue
Block a user