diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2015-05-08 22:09:13 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-05-11 10:50:17 -0400 |
commit | 11aa9c28b4209242a9de0a661a7b3405adb568a0 (patch) | |
tree | d0dda021d89c17c54d54d227269f937d2d73b542 /net/x25 | |
parent | eeb1bd5c40edb0e2fd925c8535e2fdebdbc5cef2 (diff) |
net: Pass kern from net_proto_family.create to sk_alloc
In preparation for changing how struct net is refcounted
on kernel sockets pass the knowledge that we are creating
a kernel socket from sock_create_kern through to sk_alloc.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/x25')
-rw-r--r-- | net/x25/af_x25.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index c3ab230e4493..a750f330b8dd 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c | |||
@@ -515,10 +515,10 @@ static struct proto x25_proto = { | |||
515 | .obj_size = sizeof(struct x25_sock), | 515 | .obj_size = sizeof(struct x25_sock), |
516 | }; | 516 | }; |
517 | 517 | ||
518 | static struct sock *x25_alloc_socket(struct net *net) | 518 | static struct sock *x25_alloc_socket(struct net *net, int kern) |
519 | { | 519 | { |
520 | struct x25_sock *x25; | 520 | struct x25_sock *x25; |
521 | struct sock *sk = sk_alloc(net, AF_X25, GFP_ATOMIC, &x25_proto); | 521 | struct sock *sk = sk_alloc(net, AF_X25, GFP_ATOMIC, &x25_proto, kern); |
522 | 522 | ||
523 | if (!sk) | 523 | if (!sk) |
524 | goto out; | 524 | goto out; |
@@ -553,7 +553,7 @@ static int x25_create(struct net *net, struct socket *sock, int protocol, | |||
553 | goto out; | 553 | goto out; |
554 | 554 | ||
555 | rc = -ENOBUFS; | 555 | rc = -ENOBUFS; |
556 | if ((sk = x25_alloc_socket(net)) == NULL) | 556 | if ((sk = x25_alloc_socket(net, kern)) == NULL) |
557 | goto out; | 557 | goto out; |
558 | 558 | ||
559 | x25 = x25_sk(sk); | 559 | x25 = x25_sk(sk); |
@@ -602,7 +602,7 @@ static struct sock *x25_make_new(struct sock *osk) | |||
602 | if (osk->sk_type != SOCK_SEQPACKET) | 602 | if (osk->sk_type != SOCK_SEQPACKET) |
603 | goto out; | 603 | goto out; |
604 | 604 | ||
605 | if ((sk = x25_alloc_socket(sock_net(osk))) == NULL) | 605 | if ((sk = x25_alloc_socket(sock_net(osk), 0)) == NULL) |
606 | goto out; | 606 | goto out; |
607 | 607 | ||
608 | x25 = x25_sk(sk); | 608 | x25 = x25_sk(sk); |