Skip to content

Commit 911cb19

Browse files
Rob Landleydavem330
authored andcommitted
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>
1 parent c3968a8 commit 911cb19

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

‎net/core/net_namespace.c‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,14 @@ static void net_free(struct net *net)
216216
kmem_cache_free(net_cachep, net);
217217
}
218218

219-
static struct net *net_create(void)
219+
struct net *copy_net_ns(unsigned long flags, struct net *old_net)
220220
{
221221
struct net *net;
222222
int rv;
223223

224+
if (!(flags & CLONE_NEWNET))
225+
return get_net(old_net);
226+
224227
net = net_alloc();
225228
if (!net)
226229
return ERR_PTR(-ENOMEM);
@@ -239,13 +242,6 @@ static struct net *net_create(void)
239242
return net;
240243
}
241244

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-
249245
static DEFINE_SPINLOCK(cleanup_list_lock);
250246
static LIST_HEAD(cleanup_list); /* Must hold cleanup_list_lock to touch */
251247

0 commit comments

Comments
 (0)