diff options
| author | Rob Landley <rlandley@parallels.com> | 2011-04-14 22:26:25 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2011-04-15 18:47:51 -0400 |
| commit | 911cb193f3eb0370f20fbba712211e55ffede4de (patch) | |
| tree | 853892fe31f307aad7c9501c8429668522eb6626 | |
| parent | c3968a857a6b6c3d2ef4ead35776b055fb664d74 (diff) | |
net: minor cleanup to net_namespace.c.
Inline a small static function that's only ever called from one place.
Signed-off-by: Rob Landley <rlandley@parallels.com>
Reviewed-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | net/core/net_namespace.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 3f860261c5ee..1abb50841046 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c | |||
| @@ -216,11 +216,14 @@ static void net_free(struct net *net) | |||
| 216 | kmem_cache_free(net_cachep, net); | 216 | kmem_cache_free(net_cachep, net); |
| 217 | } | 217 | } |
| 218 | 218 | ||
| 219 | static struct net *net_create(void) | 219 | struct net *copy_net_ns(unsigned long flags, struct net *old_net) |
| 220 | { | 220 | { |
| 221 | struct net *net; | 221 | struct net *net; |
| 222 | int rv; | 222 | int rv; |
| 223 | 223 | ||
| 224 | if (!(flags & CLONE_NEWNET)) | ||
| 225 | return get_net(old_net); | ||
| 226 | |||
| 224 | net = net_alloc(); | 227 | net = net_alloc(); |
| 225 | if (!net) | 228 | if (!net) |
| 226 | return ERR_PTR(-ENOMEM); | 229 | return ERR_PTR(-ENOMEM); |
| @@ -239,13 +242,6 @@ static struct net *net_create(void) | |||
| 239 | return net; | 242 | return net; |
| 240 | } | 243 | } |
| 241 | 244 | ||
| 242 | struct net *copy_net_ns(unsigned long flags, struct net *old_net) | ||
| 243 | { | ||
| 244 | if (!(flags & CLONE_NEWNET)) | ||
| 245 | return get_net(old_net); | ||
| 246 | return net_create(); | ||
| 247 | } | ||
| 248 | |||
| 249 | static DEFINE_SPINLOCK(cleanup_list_lock); | 245 | static DEFINE_SPINLOCK(cleanup_list_lock); |
| 250 | static LIST_HEAD(cleanup_list); /* Must hold cleanup_list_lock to touch */ | 246 | static LIST_HEAD(cleanup_list); /* Must hold cleanup_list_lock to touch */ |
| 251 | 247 | ||
