[BRIDGE]: Fix fdb RCU race
[linux-2.6.22.y-op.git] / net / rxrpc / internal.h
blobcc0c5795a103c458554bca62d51596a137f6ebb4
1 /* internal.h: internal Rx RPC stuff
3 * Copyright (c) 2002 David Howells (dhowells@redhat.com).
4 */
6 #ifndef RXRPC_INTERNAL_H
7 #define RXRPC_INTERNAL_H
9 #include <linux/compiler.h>
10 #include <linux/kernel.h>
13 * debug accounting
15 #if 1
16 #define __RXACCT_DECL(X) X
17 #define __RXACCT(X) do { X; } while(0)
18 #else
19 #define __RXACCT_DECL(X)
20 #define __RXACCT(X) do { } while(0)
21 #endif
23 __RXACCT_DECL(extern atomic_t rxrpc_transport_count);
24 __RXACCT_DECL(extern atomic_t rxrpc_peer_count);
25 __RXACCT_DECL(extern atomic_t rxrpc_connection_count);
26 __RXACCT_DECL(extern atomic_t rxrpc_call_count);
27 __RXACCT_DECL(extern atomic_t rxrpc_message_count);
30 * debug tracing
32 #define kenter(FMT, a...) printk("==> %s("FMT")\n",__FUNCTION__ , ##a)
33 #define kleave(FMT, a...) printk("<== %s()"FMT"\n",__FUNCTION__ , ##a)
34 #define kdebug(FMT, a...) printk(" "FMT"\n" , ##a)
35 #define kproto(FMT, a...) printk("### "FMT"\n" , ##a)
36 #define knet(FMT, a...) printk(" "FMT"\n" , ##a)
38 #if 0
39 #define _enter(FMT, a...) kenter(FMT , ##a)
40 #define _leave(FMT, a...) kleave(FMT , ##a)
41 #define _debug(FMT, a...) kdebug(FMT , ##a)
42 #define _proto(FMT, a...) kproto(FMT , ##a)
43 #define _net(FMT, a...) knet(FMT , ##a)
44 #else
45 #define _enter(FMT, a...) do { if (rxrpc_ktrace) kenter(FMT , ##a); } while(0)
46 #define _leave(FMT, a...) do { if (rxrpc_ktrace) kleave(FMT , ##a); } while(0)
47 #define _debug(FMT, a...) do { if (rxrpc_kdebug) kdebug(FMT , ##a); } while(0)
48 #define _proto(FMT, a...) do { if (rxrpc_kproto) kproto(FMT , ##a); } while(0)
49 #define _net(FMT, a...) do { if (rxrpc_knet) knet (FMT , ##a); } while(0)
50 #endif
52 static inline void rxrpc_discard_my_signals(void)
54 while (signal_pending(current)) {
55 siginfo_t sinfo;
57 spin_lock_irq(&current->sighand->siglock);
58 dequeue_signal(current, &current->blocked, &sinfo);
59 spin_unlock_irq(&current->sighand->siglock);
64 * call.c
66 extern struct list_head rxrpc_calls;
67 extern struct rw_semaphore rxrpc_calls_sem;
70 * connection.c
72 extern struct list_head rxrpc_conns;
73 extern struct rw_semaphore rxrpc_conns_sem;
74 extern unsigned long rxrpc_conn_timeout;
76 extern void rxrpc_conn_clearall(struct rxrpc_peer *peer);
79 * peer.c
81 extern struct list_head rxrpc_peers;
82 extern struct rw_semaphore rxrpc_peers_sem;
83 extern unsigned long rxrpc_peer_timeout;
85 extern void rxrpc_peer_calculate_rtt(struct rxrpc_peer *peer,
86 struct rxrpc_message *msg,
87 struct rxrpc_message *resp);
89 extern void rxrpc_peer_clearall(struct rxrpc_transport *trans);
93 * proc.c
95 #ifdef CONFIG_PROC_FS
96 extern int rxrpc_proc_init(void);
97 extern void rxrpc_proc_cleanup(void);
98 #endif
101 * transport.c
103 extern struct list_head rxrpc_proc_transports;
104 extern struct rw_semaphore rxrpc_proc_transports_sem;
106 #endif /* RXRPC_INTERNAL_H */