• Stephen Hemminger's avatar
    [NET]: Support for lots of netdevs -- faster dev_alloc_name · f8c11435
    Stephen Hemminger authored
    Convert dev_alloc_name from O(n^2) lookup to O(n) by using a page as
    bitmap to figure out how many devices of that pattern have been allocated.
    This works for up to 32k devices (PAGE_SIZE*8) on i386, more on other
    platforms.  Correctly handles the boundary cases where number of devices
    won't fit because name length is limited.
    
    Adds strnchr to the string libraries since we need to find the % format
    character, but only care if it is in the first 15 bytes.
    f8c11435
dev.c 79.1 KB