Commit 80924e5f authored by Vitaliy Gusev's avatar Vitaliy Gusev Committed by David S. Miller

tun: use tun_sk instead container_of

Using macro tun_sk is more clear and shorter. However tun.c has tun_sk,
but doesn't use it.
Signed-off-by: default avatarVitaliy Gusev <vgusev@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 08fafd84
...@@ -849,13 +849,13 @@ static void tun_sock_write_space(struct sock *sk) ...@@ -849,13 +849,13 @@ static void tun_sock_write_space(struct sock *sk)
if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
wake_up_interruptible_sync(sk->sk_sleep); wake_up_interruptible_sync(sk->sk_sleep);
tun = container_of(sk, struct tun_sock, sk)->tun; tun = tun_sk(sk)->tun;
kill_fasync(&tun->fasync, SIGIO, POLL_OUT); kill_fasync(&tun->fasync, SIGIO, POLL_OUT);
} }
static void tun_sock_destruct(struct sock *sk) static void tun_sock_destruct(struct sock *sk)
{ {
free_netdev(container_of(sk, struct tun_sock, sk)->tun->dev); free_netdev(tun_sk(sk)->tun->dev);
} }
static struct proto tun_proto = { static struct proto tun_proto = {
...@@ -990,7 +990,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) ...@@ -990,7 +990,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
sk->sk_write_space = tun_sock_write_space; sk->sk_write_space = tun_sock_write_space;
sk->sk_sndbuf = INT_MAX; sk->sk_sndbuf = INT_MAX;
container_of(sk, struct tun_sock, sk)->tun = tun; tun_sk(sk)->tun = tun;
security_tun_dev_post_create(sk); security_tun_dev_post_create(sk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment