aboutsummaryrefslogtreecommitdiff
path: root/include/net/net_namespace.h
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-07-07 22:21:34 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-07-07 22:21:34 +0100
commitfa6868508a0102b150ca03d976e3a1c234e4e387 (patch)
tree2b252f262695544e5caeb2bd983f8cac5158a8f6 /include/net/net_namespace.h
parent5b2353859f87748f0707cec57c3953022a3321f3 (diff)
parent4ed47896935573c8423d05bddda3f269d6e6c613 (diff)
Merge branch 'machtypes' into orion
Diffstat (limited to 'include/net/net_namespace.h')
-rw-r--r--include/net/net_namespace.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index aa540e6be50..d9dd0f70729 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -95,6 +95,11 @@ extern struct list_head net_namespace_list;
#ifdef CONFIG_NET_NS
extern void __put_net(struct net *net);
+static inline int net_alive(struct net *net)
+{
+ return net && atomic_read(&net->count);
+}
+
static inline struct net *get_net(struct net *net)
{
atomic_inc(&net->count);
@@ -125,6 +130,12 @@ int net_eq(const struct net *net1, const struct net *net2)
return net1 == net2;
}
#else
+
+static inline int net_alive(struct net *net)
+{
+ return 1;
+}
+
static inline struct net *get_net(struct net *net)
{
return net;