diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-06-25 06:32:01 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-06-25 06:32:01 -0400 |
| commit | da7878d75b8520c9ae00d27dfbbce546a7bfdfbb (patch) | |
| tree | 547fd497a80818a60ac36831377d5df97868173c /include/net/net_namespace.h | |
| parent | 0e50a4c6ab94ffe7e5515b86b5df9e5abc8c6b13 (diff) | |
| parent | 543cf4cb3fe6f6cae3651ba918b9c56200b257d0 (diff) | |
Merge branch 'linus' into x86/pebs
Diffstat (limited to 'include/net/net_namespace.h')
| -rw-r--r-- | include/net/net_namespace.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index aa540e6be502..d9dd0f707296 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
| @@ -95,6 +95,11 @@ extern struct list_head net_namespace_list; | |||
| 95 | #ifdef CONFIG_NET_NS | 95 | #ifdef CONFIG_NET_NS |
| 96 | extern void __put_net(struct net *net); | 96 | extern void __put_net(struct net *net); |
| 97 | 97 | ||
| 98 | static inline int net_alive(struct net *net) | ||
| 99 | { | ||
| 100 | return net && atomic_read(&net->count); | ||
| 101 | } | ||
| 102 | |||
| 98 | static inline struct net *get_net(struct net *net) | 103 | static inline struct net *get_net(struct net *net) |
| 99 | { | 104 | { |
| 100 | atomic_inc(&net->count); | 105 | atomic_inc(&net->count); |
| @@ -125,6 +130,12 @@ int net_eq(const struct net *net1, const struct net *net2) | |||
| 125 | return net1 == net2; | 130 | return net1 == net2; |
| 126 | } | 131 | } |
| 127 | #else | 132 | #else |
| 133 | |||
| 134 | static inline int net_alive(struct net *net) | ||
| 135 | { | ||
| 136 | return 1; | ||
| 137 | } | ||
| 138 | |||
| 128 | static inline struct net *get_net(struct net *net) | 139 | static inline struct net *get_net(struct net *net) |
| 129 | { | 140 | { |
| 130 | return net; | 141 | return net; |
