diff options
author | Adrian Bunk <bunk@stusta.de> | 2007-07-30 21:05:45 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-31 05:28:27 -0400 |
commit | 131116989b5c349f9b1ab9ee083d37cc73160ac8 (patch) | |
tree | 6b381fc02ec93bd5f02da685124a6ca45c77cd46 /net/unix | |
parent | 1a3a206f7f2aa50545cc3d056405ad7bc3c9bca8 (diff) |
[AF_UNIX]: Make code static.
The following code can now become static:
- struct unix_socket_table
- unix_table_lock
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/unix')
-rw-r--r-- | net/unix/af_unix.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 65ebccc0a698..a05c34260e70 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -118,14 +118,40 @@ | |||
118 | 118 | ||
119 | int sysctl_unix_max_dgram_qlen __read_mostly = 10; | 119 | int sysctl_unix_max_dgram_qlen __read_mostly = 10; |
120 | 120 | ||
121 | struct hlist_head unix_socket_table[UNIX_HASH_SIZE + 1]; | 121 | static struct hlist_head unix_socket_table[UNIX_HASH_SIZE + 1]; |
122 | DEFINE_SPINLOCK(unix_table_lock); | 122 | static DEFINE_SPINLOCK(unix_table_lock); |
123 | static atomic_t unix_nr_socks = ATOMIC_INIT(0); | 123 | static atomic_t unix_nr_socks = ATOMIC_INIT(0); |
124 | 124 | ||
125 | #define unix_sockets_unbound (&unix_socket_table[UNIX_HASH_SIZE]) | 125 | #define unix_sockets_unbound (&unix_socket_table[UNIX_HASH_SIZE]) |
126 | 126 | ||
127 | #define UNIX_ABSTRACT(sk) (unix_sk(sk)->addr->hash != UNIX_HASH_SIZE) | 127 | #define UNIX_ABSTRACT(sk) (unix_sk(sk)->addr->hash != UNIX_HASH_SIZE) |
128 | 128 | ||
129 | static struct sock *first_unix_socket(int *i) | ||
130 | { | ||
131 | for (*i = 0; *i <= UNIX_HASH_SIZE; (*i)++) { | ||
132 | if (!hlist_empty(&unix_socket_table[*i])) | ||
133 | return __sk_head(&unix_socket_table[*i]); | ||
134 | } | ||
135 | return NULL; | ||
136 | } | ||
137 | |||
138 | static struct sock *next_unix_socket(int *i, struct sock *s) | ||
139 | { | ||
140 | struct sock *next = sk_next(s); | ||
141 | /* More in this chain? */ | ||
142 | if (next) | ||
143 | return next; | ||
144 | /* Look for next non-empty chain. */ | ||
145 | for ((*i)++; *i <= UNIX_HASH_SIZE; (*i)++) { | ||
146 | if (!hlist_empty(&unix_socket_table[*i])) | ||
147 | return __sk_head(&unix_socket_table[*i]); | ||
148 | } | ||
149 | return NULL; | ||
150 | } | ||
151 | |||
152 | #define forall_unix_sockets(i, s) \ | ||
153 | for (s = first_unix_socket(&(i)); s; s = next_unix_socket(&(i),(s))) | ||
154 | |||
129 | #ifdef CONFIG_SECURITY_NETWORK | 155 | #ifdef CONFIG_SECURITY_NETWORK |
130 | static void unix_get_secdata(struct scm_cookie *scm, struct sk_buff *skb) | 156 | static void unix_get_secdata(struct scm_cookie *scm, struct sk_buff *skb) |
131 | { | 157 | { |