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/bluetooth/l2cap_sock.c | |
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/bluetooth/l2cap_sock.c')
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index a7278f05eafb..244287706f91 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
@@ -43,7 +43,7 @@ static struct bt_sock_list l2cap_sk_list = { | |||
43 | static const struct proto_ops l2cap_sock_ops; | 43 | static const struct proto_ops l2cap_sock_ops; |
44 | static void l2cap_sock_init(struct sock *sk, struct sock *parent); | 44 | static void l2cap_sock_init(struct sock *sk, struct sock *parent); |
45 | static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, | 45 | static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, |
46 | int proto, gfp_t prio); | 46 | int proto, gfp_t prio, int kern); |
47 | 47 | ||
48 | bool l2cap_is_socket(struct socket *sock) | 48 | bool l2cap_is_socket(struct socket *sock) |
49 | { | 49 | { |
@@ -1193,7 +1193,7 @@ static struct l2cap_chan *l2cap_sock_new_connection_cb(struct l2cap_chan *chan) | |||
1193 | } | 1193 | } |
1194 | 1194 | ||
1195 | sk = l2cap_sock_alloc(sock_net(parent), NULL, BTPROTO_L2CAP, | 1195 | sk = l2cap_sock_alloc(sock_net(parent), NULL, BTPROTO_L2CAP, |
1196 | GFP_ATOMIC); | 1196 | GFP_ATOMIC, 0); |
1197 | if (!sk) { | 1197 | if (!sk) { |
1198 | release_sock(parent); | 1198 | release_sock(parent); |
1199 | return NULL; | 1199 | return NULL; |
@@ -1523,12 +1523,12 @@ static struct proto l2cap_proto = { | |||
1523 | }; | 1523 | }; |
1524 | 1524 | ||
1525 | static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, | 1525 | static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, |
1526 | int proto, gfp_t prio) | 1526 | int proto, gfp_t prio, int kern) |
1527 | { | 1527 | { |
1528 | struct sock *sk; | 1528 | struct sock *sk; |
1529 | struct l2cap_chan *chan; | 1529 | struct l2cap_chan *chan; |
1530 | 1530 | ||
1531 | sk = sk_alloc(net, PF_BLUETOOTH, prio, &l2cap_proto); | 1531 | sk = sk_alloc(net, PF_BLUETOOTH, prio, &l2cap_proto, kern); |
1532 | if (!sk) | 1532 | if (!sk) |
1533 | return NULL; | 1533 | return NULL; |
1534 | 1534 | ||
@@ -1574,7 +1574,7 @@ static int l2cap_sock_create(struct net *net, struct socket *sock, int protocol, | |||
1574 | 1574 | ||
1575 | sock->ops = &l2cap_sock_ops; | 1575 | sock->ops = &l2cap_sock_ops; |
1576 | 1576 | ||
1577 | sk = l2cap_sock_alloc(net, sock, protocol, GFP_ATOMIC); | 1577 | sk = l2cap_sock_alloc(net, sock, protocol, GFP_ATOMIC, kern); |
1578 | if (!sk) | 1578 | if (!sk) |
1579 | return -ENOMEM; | 1579 | return -ENOMEM; |
1580 | 1580 | ||