summaryrefslogtreecommitdiffstats
path: root/include/net/net_namespace.h
diff options
context:
space:
mode:
authorDavid S. Miller2008-06-28 10:19:40 +0200
committerDavid S. Miller2008-06-28 10:19:40 +0200
commit1b63ba8a86c85524a8d7e5953b314ce71ebcb9c9 (patch)
treefe3dc41cbb47ae12b7c3faf6a88b097349e50d5a /include/net/net_namespace.h
parentbnx2x: Update version (diff)
parentipv6 route: Convert rt6_device_match() to use RT6_LOOKUP_F_xxx flags. (diff)
downloadkernel-qcow2-linux-1b63ba8a86c85524a8d7e5953b314ce71ebcb9c9.tar.gz
kernel-qcow2-linux-1b63ba8a86c85524a8d7e5953b314ce71ebcb9c9.tar.xz
kernel-qcow2-linux-1b63ba8a86c85524a8d7e5953b314ce71ebcb9c9.zip
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/wireless/iwlwifi/iwl4965-base.c
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 8df751b3be55..f90443045c70 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;