summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@parallels.com>2011-12-15 02:44:03 +0000
committerDavid S. Miller <davem@davemloft.net>2011-12-16 13:48:27 -0500
commitfa7ff56f75add89bbedaf2dfcfa8f6661e8e8b3a (patch)
tree60e3b442d75f4559c5447392d524c49ccc81d28e
parentf65c1b534b99aef1809b893387b295963821549f (diff)
downloadlinux-3.10-fa7ff56f75add89bbedaf2dfcfa8f6661e8e8b3a.tar.gz
linux-3.10-fa7ff56f75add89bbedaf2dfcfa8f6661e8e8b3a.tar.bz2
linux-3.10-fa7ff56f75add89bbedaf2dfcfa8f6661e8e8b3a.zip
af_unix: Export stuff required for diag module
Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-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 91ab5b01678..63b17816e0b 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -11,10 +11,13 @@ extern void unix_notinflight(struct file *fp);
extern void unix_gc(void);
extern void wait_for_unix_gc(void);
extern struct sock *unix_get_socket(struct file *filp);
+extern struct sock *unix_peer_get(struct sock *);
#define UNIX_HASH_SIZE 256
extern unsigned int unix_tot_inflight;
+extern spinlock_t unix_table_lock;
+extern struct hlist_head unix_socket_table[UNIX_HASH_SIZE + 1];
struct unix_address {
atomic_t refcnt;
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index b595a3d8679..e1b9358a211 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -115,8 +115,10 @@
#include <net/checksum.h>
#include <linux/security.h>
-static struct hlist_head unix_socket_table[UNIX_HASH_SIZE + 1];
-static DEFINE_SPINLOCK(unix_table_lock);
+struct hlist_head unix_socket_table[UNIX_HASH_SIZE + 1];
+EXPORT_SYMBOL_GPL(unix_socket_table);
+DEFINE_SPINLOCK(unix_table_lock);
+EXPORT_SYMBOL_GPL(unix_table_lock);
static atomic_long_t unix_nr_socks;
#define unix_sockets_unbound (&unix_socket_table[UNIX_HASH_SIZE])
@@ -172,7 +174,7 @@ static inline int unix_recvq_full(struct sock const *sk)
return skb_queue_len(&sk->sk_receive_queue) > sk->sk_max_ack_backlog;
}
-static struct sock *unix_peer_get(struct sock *s)
+struct sock *unix_peer_get(struct sock *s)
{
struct sock *peer;
@@ -183,6 +185,7 @@ static struct sock *unix_peer_get(struct sock *s)
unix_state_unlock(s);
return peer;
}
+EXPORT_SYMBOL_GPL(unix_peer_get);
static inline void unix_release_addr(struct unix_address *addr)
{