]> git.hungrycats.org Git - linux/commit
[NET]: Support for lots of netdevs -- faster dev_alloc_name
authorStephen Hemminger <shemminger@osdl.org>
Fri, 6 Feb 2004 06:24:10 +0000 (22:24 -0800)
committerStephen Hemminger <shemminger@osdl.org>
Fri, 6 Feb 2004 06:24:10 +0000 (22:24 -0800)
commitf8c11435c19d5cee964370d8fd62d397f2b4c212
treedd6c5b2d5ef8dc67fc3cf06eedea9416a51121e5
parent6434c04175e058429430e2064d3a0ce112ce45ad
[NET]: Support for lots of netdevs -- faster dev_alloc_name

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.
include/linux/string.h
lib/string.c
net/core/dev.c