• Tejun Heo's avatar
    percpu: move chunk area map extension out of area allocation · 9f7dcf22
    Tejun Heo authored
    Impact: code reorganization for later changes
    
    Separate out chunk area map extension into a separate function -
    pcpu_extend_area_map() - and call it directly from pcpu_alloc() such
    that pcpu_alloc_area() is guaranteed to have enough area map slots on
    invocation.
    
    With this change, pcpu_alloc_area() does only area allocation and the
    only failure mode is when the chunk doens't have enough room, so
    there's no need to distinguish it from memory allocation failures.
    Make it return -1 on such cases instead of hacky -ENOSPC.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    9f7dcf22
percpu.c 31.2 KB