aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/inet_hashtables.h
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2008-11-12 03:54:20 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-12 03:54:20 -0500
commit7a9546ee354ec6f23af403992b8c07baa50a23d2 (patch)
tree8536e2f4aa79921c0b2666795cdff91be80a2057 /include/net/inet_hashtables.h
parent8f424b5f32d78b4f353b3cddca9804808ef063eb (diff)
net: ib_net pointer should depends on CONFIG_NET_NS
We can shrink size of "struct inet_bind_bucket" by 50%, using read_pnet() and write_pnet() Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/inet_hashtables.h')
-rw-r--r--include/net/inet_hashtables.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 5cc182f9eca..cb31fbf8ae2 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -77,13 +77,20 @@ struct inet_ehash_bucket {
77 * ports are created in O(1) time? I thought so. ;-) -DaveM 77 * ports are created in O(1) time? I thought so. ;-) -DaveM
78 */ 78 */
79struct inet_bind_bucket { 79struct inet_bind_bucket {
80#ifdef CONFIG_NET_NS
80 struct net *ib_net; 81 struct net *ib_net;
82#endif
81 unsigned short port; 83 unsigned short port;
82 signed short fastreuse; 84 signed short fastreuse;
83 struct hlist_node node; 85 struct hlist_node node;
84 struct hlist_head owners; 86 struct hlist_head owners;
85}; 87};
86 88
89static inline struct net *ib_net(struct inet_bind_bucket *ib)
90{
91 return read_pnet(&ib->ib_net);
92}
93
87#define inet_bind_bucket_for_each(tb, node, head) \ 94#define inet_bind_bucket_for_each(tb, node, head) \
88 hlist_for_each_entry(tb, node, head, node) 95 hlist_for_each_entry(tb, node, head, node)
89 96