sock.c (9e9fd65d1fa51d919d54d731be0e66492b5b6c5a) sock.c (46d3ceabd8d98ed0ad10f20c595ca784e34786c5)
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Generic socket support routines. Memory allocators, socket lock/release
7 * handler for protocols to use and generic option handler.
8 *

--- 1451 unchanged lines hidden (view full) ---

1460 struct sock *sk = skb->sk;
1461 unsigned int len = skb->truesize;
1462
1463 atomic_sub(len, &sk->sk_rmem_alloc);
1464 sk_mem_uncharge(sk, len);
1465}
1466EXPORT_SYMBOL(sock_rfree);
1467
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Generic socket support routines. Memory allocators, socket lock/release
7 * handler for protocols to use and generic option handler.
8 *

--- 1451 unchanged lines hidden (view full) ---

1460 struct sock *sk = skb->sk;
1461 unsigned int len = skb->truesize;
1462
1463 atomic_sub(len, &sk->sk_rmem_alloc);
1464 sk_mem_uncharge(sk, len);
1465}
1466EXPORT_SYMBOL(sock_rfree);
1467
1468void sock_edemux(struct sk_buff *skb)
1469{
1470 sock_put(skb->sk);
1471}
1472EXPORT_SYMBOL(sock_edemux);
1468
1469int sock_i_uid(struct sock *sk)
1470{
1471 int uid;
1472
1473 read_lock_bh(&sk->sk_callback_lock);
1474 uid = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_uid : 0;
1475 read_unlock_bh(&sk->sk_callback_lock);

--- 673 unchanged lines hidden (view full) ---

2149 /*
2150 * The sk_lock has mutex_unlock() semantics:
2151 */
2152 mutex_release(&sk->sk_lock.dep_map, 1, _RET_IP_);
2153
2154 spin_lock_bh(&sk->sk_lock.slock);
2155 if (sk->sk_backlog.tail)
2156 __release_sock(sk);
1473
1474int sock_i_uid(struct sock *sk)
1475{
1476 int uid;
1477
1478 read_lock_bh(&sk->sk_callback_lock);
1479 uid = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_uid : 0;
1480 read_unlock_bh(&sk->sk_callback_lock);

--- 673 unchanged lines hidden (view full) ---

2154 /*
2155 * The sk_lock has mutex_unlock() semantics:
2156 */
2157 mutex_release(&sk->sk_lock.dep_map, 1, _RET_IP_);
2158
2159 spin_lock_bh(&sk->sk_lock.slock);
2160 if (sk->sk_backlog.tail)
2161 __release_sock(sk);
2162
2163 if (sk->sk_prot->release_cb)
2164 sk->sk_prot->release_cb(sk);
2165
2157 sk->sk_lock.owned = 0;
2158 if (waitqueue_active(&sk->sk_lock.wq))
2159 wake_up(&sk->sk_lock.wq);
2160 spin_unlock_bh(&sk->sk_lock.slock);
2161}
2162EXPORT_SYMBOL(release_sock);
2163
2164/**

--- 519 unchanged lines hidden ---
2166 sk->sk_lock.owned = 0;
2167 if (waitqueue_active(&sk->sk_lock.wq))
2168 wake_up(&sk->sk_lock.wq);
2169 spin_unlock_bh(&sk->sk_lock.slock);
2170}
2171EXPORT_SYMBOL(release_sock);
2172
2173/**

--- 519 unchanged lines hidden ---