aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sock.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/sock.h')
-rw-r--r--include/net/sock.h29
1 files changed, 20 insertions, 9 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 40bb90ebb2d1..26fc0b16bc0c 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -745,7 +745,13 @@ static inline int sk_stream_wmem_schedule(struct sock *sk, int size)
745 */ 745 */
746#define sock_owned_by_user(sk) ((sk)->sk_lock.owner) 746#define sock_owned_by_user(sk) ((sk)->sk_lock.owner)
747 747
748extern void FASTCALL(lock_sock(struct sock *sk)); 748extern void FASTCALL(lock_sock_nested(struct sock *sk, int subclass));
749
750static inline void lock_sock(struct sock *sk)
751{
752 lock_sock_nested(sk, 0);
753}
754
749extern void FASTCALL(release_sock(struct sock *sk)); 755extern void FASTCALL(release_sock(struct sock *sk));
750 756
751/* BH context may only use the following locking interface. */ 757/* BH context may only use the following locking interface. */
@@ -883,19 +889,23 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb)
883} 889}
884 890
885/** 891/**
886 * sk_filter_release: Release a socket filter 892 * sk_filter_rcu_free: Free a socket filter
887 * @sk: socket 893 * @rcu: rcu_head that contains the sk_filter to free
888 * @fp: filter to remove
889 *
890 * Remove a filter from a socket and release its resources.
891 */ 894 */
892
893static inline void sk_filter_rcu_free(struct rcu_head *rcu) 895static inline void sk_filter_rcu_free(struct rcu_head *rcu)
894{ 896{
895 struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu); 897 struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu);
896 kfree(fp); 898 kfree(fp);
897} 899}
898 900
901/**
902 * sk_filter_release: Release a socket filter
903 * @sk: socket
904 * @fp: filter to remove
905 *
906 * Remove a filter from a socket and release its resources.
907 */
908
899static inline void sk_filter_release(struct sock *sk, struct sk_filter *fp) 909static inline void sk_filter_release(struct sock *sk, struct sk_filter *fp)
900{ 910{
901 unsigned int size = sk_filter_len(fp); 911 unsigned int size = sk_filter_len(fp);
@@ -944,7 +954,8 @@ static inline void sock_put(struct sock *sk)
944 sk_free(sk); 954 sk_free(sk);
945} 955}
946 956
947extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb); 957extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb,
958 const int nested);
948 959
949/* Detach socket from process context. 960/* Detach socket from process context.
950 * Announce socket dead, detach it from wait queue and inode. 961 * Announce socket dead, detach it from wait queue and inode.
@@ -1078,7 +1089,7 @@ static inline int skb_copy_to_page(struct sock *sk, char __user *from,
1078{ 1089{
1079 if (skb->ip_summed == CHECKSUM_NONE) { 1090 if (skb->ip_summed == CHECKSUM_NONE) {
1080 int err = 0; 1091 int err = 0;
1081 unsigned int csum = csum_and_copy_from_user(from, 1092 __wsum csum = csum_and_copy_from_user(from,
1082 page_address(page) + off, 1093 page_address(page) + off,
1083 copy, 0, &err); 1094 copy, 0, &err);
1084 if (err) 1095 if (err)