summaryrefslogtreecommitdiff
path: root/include/net/net_namespace.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-06-23 11:30:23 +0200
committerIngo Molnar <mingo@elte.hu>2008-06-23 11:30:23 +0200
commit1de8644cc7c826e0c41e52825bd5a12e2e31e6ca (patch)
treedf1e884080599facaf70d2675c480e999da953e1 /include/net/net_namespace.h
parent6c3df25511c2c51f2dd36cc52a8d22363d731793 (diff)
parent481c5346d0981940ee63037eb53e4e37b0735c10 (diff)
Merge branch 'linus' into sched/develtip-sched-devel-2008-06-23_09.30_Mon
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 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;
#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;