summaryrefslogtreecommitdiffstats
path: root/net/iucv
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2015-05-08 22:09:13 -0400
committerDavid S. Miller <davem@davemloft.net>2015-05-11 10:50:17 -0400
commit11aa9c28b4209242a9de0a661a7b3405adb568a0 (patch)
treed0dda021d89c17c54d54d227269f937d2d73b542 /net/iucv
parenteeb1bd5c40edb0e2fd925c8535e2fdebdbc5cef2 (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/iucv')
-rw-r--r--net/iucv/af_iucv.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index 6daa52a18d40..918151c11348 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -535,12 +535,12 @@ static void iucv_sock_init(struct sock *sk, struct sock *parent)
535 sk->sk_type = parent->sk_type; 535 sk->sk_type = parent->sk_type;
536} 536}
537 537
538static struct sock *iucv_sock_alloc(struct socket *sock, int proto, gfp_t prio) 538static struct sock *iucv_sock_alloc(struct socket *sock, int proto, gfp_t prio, int kern)
539{ 539{
540 struct sock *sk; 540 struct sock *sk;
541 struct iucv_sock *iucv; 541 struct iucv_sock *iucv;
542 542
543 sk = sk_alloc(&init_net, PF_IUCV, prio, &iucv_proto); 543 sk = sk_alloc(&init_net, PF_IUCV, prio, &iucv_proto, kern);
544 if (!sk) 544 if (!sk)
545 return NULL; 545 return NULL;
546 iucv = iucv_sk(sk); 546 iucv = iucv_sk(sk);
@@ -602,7 +602,7 @@ static int iucv_sock_create(struct net *net, struct socket *sock, int protocol,
602 return -ESOCKTNOSUPPORT; 602 return -ESOCKTNOSUPPORT;
603 } 603 }
604 604
605 sk = iucv_sock_alloc(sock, protocol, GFP_KERNEL); 605 sk = iucv_sock_alloc(sock, protocol, GFP_KERNEL, kern);
606 if (!sk) 606 if (!sk)
607 return -ENOMEM; 607 return -ENOMEM;
608 608
@@ -1723,7 +1723,7 @@ static int iucv_callback_connreq(struct iucv_path *path,
1723 } 1723 }
1724 1724
1725 /* Create the new socket */ 1725 /* Create the new socket */
1726 nsk = iucv_sock_alloc(NULL, sk->sk_type, GFP_ATOMIC); 1726 nsk = iucv_sock_alloc(NULL, sk->sk_type, GFP_ATOMIC, 0);
1727 if (!nsk) { 1727 if (!nsk) {
1728 err = pr_iucv->path_sever(path, user_data); 1728 err = pr_iucv->path_sever(path, user_data);
1729 iucv_path_free(path); 1729 iucv_path_free(path);
@@ -1933,7 +1933,7 @@ static int afiucv_hs_callback_syn(struct sock *sk, struct sk_buff *skb)
1933 goto out; 1933 goto out;
1934 } 1934 }
1935 1935
1936 nsk = iucv_sock_alloc(NULL, sk->sk_type, GFP_ATOMIC); 1936 nsk = iucv_sock_alloc(NULL, sk->sk_type, GFP_ATOMIC, 0);
1937 bh_lock_sock(sk); 1937 bh_lock_sock(sk);
1938 if ((sk->sk_state != IUCV_LISTEN) || 1938 if ((sk->sk_state != IUCV_LISTEN) ||
1939 sk_acceptq_is_full(sk) || 1939 sk_acceptq_is_full(sk) ||