diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-25 14:57:35 -0400 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-25 15:40:00 -0400 |
commit | 878628fbf2589eb24357e42027d5f54b1dafd3c8 (patch) | |
tree | 30c109d8f337b3910e3b5364877c3c521dd700b5 /include/net/net_namespace.h | |
parent | 57da52c1e62c6c13875e97de6c69d3156f8416da (diff) |
[NET] NETNS: Omit namespace comparision without CONFIG_NET_NS.
Introduce an inline net_eq() to compare two namespaces.
Without CONFIG_NET_NS, since no namespace other than &init_net
exists, it is always 1.
We do not need to convert 1) inline vs inline and
2) inline vs &init_net comparisons.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'include/net/net_namespace.h')
-rw-r--r-- | include/net/net_namespace.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 923f2b8b9096..f8f3d1a5fc35 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -118,6 +118,12 @@ static inline void release_net(struct net *net) | |||
118 | { | 118 | { |
119 | atomic_dec(&net->use_count); | 119 | atomic_dec(&net->use_count); |
120 | } | 120 | } |
121 | |||
122 | static inline | ||
123 | int net_eq(const struct net *net1, const struct net *net2) | ||
124 | { | ||
125 | return net1 == net2; | ||
126 | } | ||
121 | #else | 127 | #else |
122 | static inline struct net *get_net(struct net *net) | 128 | static inline struct net *get_net(struct net *net) |
123 | { | 129 | { |
@@ -141,6 +147,12 @@ static inline struct net *maybe_get_net(struct net *net) | |||
141 | { | 147 | { |
142 | return net; | 148 | return net; |
143 | } | 149 | } |
150 | |||
151 | static inline | ||
152 | int net_eq(const struct net *net1, const struct net *net2) | ||
153 | { | ||
154 | return 1; | ||
155 | } | ||
144 | #endif | 156 | #endif |
145 | 157 | ||
146 | #define for_each_net(VAR) \ | 158 | #define for_each_net(VAR) \ |