diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2003-02-11 02:58:50 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-02-11 02:58:50 -0800 |
| commit | 962bf880ea6a95428bb53b611818b23c478b477a (patch) | |
| tree | 69a65a9fe87359aaa367b589def2ec435362629c /include | |
| parent | c409074316d9df04ff74e9ba3ada70a664f82b13 (diff) | |
| parent | b360248862bff1d718d46a86943a670e7c1c77e0 (diff) | |
Merge bk://kernel.bkbits.net/davem/sparc-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/af_unix.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index 646042b59739..d526b746b4b9 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h @@ -13,9 +13,30 @@ extern rwlock_t unix_table_lock; extern atomic_t unix_tot_inflight; +static inline unix_socket *first_unix_socket(int *i) +{ + for (*i = 0; *i <= UNIX_HASH_SIZE; (*i)++) { + if (unix_socket_table[*i]) + return unix_socket_table[*i]; + } + return NULL; +} + +static inline unix_socket *next_unix_socket(int *i, unix_socket *s) +{ + /* More in this chain? */ + if (s->next) + return s->next; + /* Look for next non-empty chain. */ + for ((*i)++; *i <= UNIX_HASH_SIZE; (*i)++) { + if (unix_socket_table[*i]) + return unix_socket_table[*i]; + } + return NULL; +} -#define forall_unix_sockets(i, s) for (i=0; i<=UNIX_HASH_SIZE; i++) \ - for (s=unix_socket_table[i]; s; s=s->next) +#define forall_unix_sockets(i, s) \ + for (s = first_unix_socket(&(i)); s; s = next_unix_socket(&(i),(s))) struct unix_address { |
