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.h28
1 files changed, 20 insertions, 8 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index ac286a353032..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,18 +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 * @rcu: rcu_head that contains the sk_filter info to remove 893 * @rcu: rcu_head that contains the sk_filter to free
888 *
889 * Remove a filter from a socket and release its resources.
890 */ 894 */
891
892static inline void sk_filter_rcu_free(struct rcu_head *rcu) 895static inline void sk_filter_rcu_free(struct rcu_head *rcu)
893{ 896{
894 struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu); 897 struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu);
895 kfree(fp); 898 kfree(fp);
896} 899}
897 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
898static 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)
899{ 910{
900 unsigned int size = sk_filter_len(fp); 911 unsigned int size = sk_filter_len(fp);
@@ -943,7 +954,8 @@ static inline void sock_put(struct sock *sk)
943 sk_free(sk); 954 sk_free(sk);
944} 955}
945 956
946extern 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);
947 959
948/* Detach socket from process context. 960/* Detach socket from process context.
949 * Announce socket dead, detach it from wait queue and inode. 961 * Announce socket dead, detach it from wait queue and inode.
@@ -1077,7 +1089,7 @@ static inline int skb_copy_to_page(struct sock *sk, char __user *from,
1077{ 1089{
1078 if (skb->ip_summed == CHECKSUM_NONE) { 1090 if (skb->ip_summed == CHECKSUM_NONE) {
1079 int err = 0; 1091 int err = 0;
1080 unsigned int csum = csum_and_copy_from_user(from, 1092 __wsum csum = csum_and_copy_from_user(from,
1081 page_address(page) + off, 1093 page_address(page) + off,
1082 copy, 0, &err); 1094 copy, 0, &err);
1083 if (err) 1095 if (err)