diff options
| author | Stephen Hemminger <shemminger@osdl.org> | 2004-02-05 22:24:10 -0800 |
|---|---|---|
| committer | Stephen Hemminger <shemminger@osdl.org> | 2004-02-05 22:24:10 -0800 |
| commit | f8c11435c19d5cee964370d8fd62d397f2b4c212 (patch) | |
| tree | dd6c5b2d5ef8dc67fc3cf06eedea9416a51121e5 /include/linux/string.h | |
| parent | 6434c04175e058429430e2064d3a0ce112ce45ad (diff) | |
[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.
Diffstat (limited to 'include/linux/string.h')
| -rw-r--r-- | include/linux/string.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/string.h b/include/linux/string.h index f37b7a6813d3..6ad4e5c32f22 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -52,6 +52,9 @@ extern int strnicmp(const char *, const char *, __kernel_size_t); #ifndef __HAVE_ARCH_STRCHR extern char * strchr(const char *,int); #endif +#ifndef __HAVE_ARCH_STRNCHR +extern char * strnchr(const char *, size_t, int); +#endif #ifndef __HAVE_ARCH_STRRCHR extern char * strrchr(const char *,int); #endif |
