aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/af_unix.h3
-rw-r--r--net/unix/af_unix.c9
2 files changed, 9 insertions, 3 deletions
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index 91ab5b01678a..63b17816e0ba 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -11,10 +11,13 @@ extern void unix_notinflight(struct file *fp);
11extern void unix_gc(void); 11extern void unix_gc(void);
12extern void wait_for_unix_gc(void); 12extern void wait_for_unix_gc(void);
13extern struct sock *unix_get_socket(struct file *filp); 13extern struct sock *unix_get_socket(struct file *filp);
14extern struct sock *unix_peer_get(struct sock *);
14 15
15#define UNIX_HASH_SIZE 256 16#define UNIX_HASH_SIZE 256
16 17
17extern unsigned int unix_tot_inflight; 18extern unsigned int unix_tot_inflight;
19extern spinlock_t unix_table_lock;
20extern struct hlist_head unix_socket_table[UNIX_HASH_SIZE + 1];
18 21
19struct unix_address { 22struct unix_address {
20 atomic_t refcnt; 23 atomic_t refcnt;
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index b595a3d8679f..e1b9358a211d 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -115,8 +115,10 @@
115#include <net/checksum.h> 115#include <net/checksum.h>
116#include <linux/security.h> 116#include <linux/security.h>
117 117
118static struct hlist_head unix_socket_table[UNIX_HASH_SIZE + 1]; 118struct hlist_head unix_socket_table[UNIX_HASH_SIZE + 1];
119static DEFINE_SPINLOCK(unix_table_lock); 119EXPORT_SYMBOL_GPL(unix_socket_table);
120DEFINE_SPINLOCK(unix_table_lock);
121EXPORT_SYMBOL_GPL(unix_table_lock);
120static atomic_long_t unix_nr_socks; 122static atomic_long_t unix_nr_socks;
121 123
122#define unix_sockets_unbound (&unix_socket_table[UNIX_HASH_SIZE]) 124#define unix_sockets_unbound (&unix_socket_table[UNIX_HASH_SIZE])
@@ -172,7 +174,7 @@ static inline int unix_recvq_full(struct sock const *sk)
172 return skb_queue_len(&sk->sk_receive_queue) > sk->sk_max_ack_backlog; 174 return skb_queue_len(&sk->sk_receive_queue) > sk->sk_max_ack_backlog;
173} 175}
174 176
175static struct sock *unix_peer_get(struct sock *s) 177struct sock *unix_peer_get(struct sock *s)
176{ 178{
177 struct sock *peer; 179 struct sock *peer;
178 180
@@ -183,6 +185,7 @@ static struct sock *unix_peer_get(struct sock *s)
183 unix_state_unlock(s); 185 unix_state_unlock(s);
184 return peer; 186 return peer;
185} 187}
188EXPORT_SYMBOL_GPL(unix_peer_get);
186 189
187static inline void unix_release_addr(struct unix_address *addr) 190static inline void unix_release_addr(struct unix_address *addr)
188{ 191{