diff options
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 5697caf8cc76..ca241ea14875 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -312,7 +312,7 @@ struct sock { | |||
312 | void *sk_security; | 312 | void *sk_security; |
313 | #endif | 313 | #endif |
314 | __u32 sk_mark; | 314 | __u32 sk_mark; |
315 | /* XXX 4 bytes hole on 64 bit */ | 315 | u32 sk_classid; |
316 | void (*sk_state_change)(struct sock *sk); | 316 | void (*sk_state_change)(struct sock *sk); |
317 | void (*sk_data_ready)(struct sock *sk, int bytes); | 317 | void (*sk_data_ready)(struct sock *sk, int bytes); |
318 | void (*sk_write_space)(struct sock *sk); | 318 | void (*sk_write_space)(struct sock *sk); |
@@ -1026,15 +1026,23 @@ extern void release_sock(struct sock *sk); | |||
1026 | SINGLE_DEPTH_NESTING) | 1026 | SINGLE_DEPTH_NESTING) |
1027 | #define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock)) | 1027 | #define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock)) |
1028 | 1028 | ||
1029 | static inline void lock_sock_bh(struct sock *sk) | 1029 | extern bool lock_sock_fast(struct sock *sk); |
1030 | /** | ||
1031 | * unlock_sock_fast - complement of lock_sock_fast | ||
1032 | * @sk: socket | ||
1033 | * @slow: slow mode | ||
1034 | * | ||
1035 | * fast unlock socket for user context. | ||
1036 | * If slow mode is on, we call regular release_sock() | ||
1037 | */ | ||
1038 | static inline void unlock_sock_fast(struct sock *sk, bool slow) | ||
1030 | { | 1039 | { |
1031 | spin_lock_bh(&sk->sk_lock.slock); | 1040 | if (slow) |
1041 | release_sock(sk); | ||
1042 | else | ||
1043 | spin_unlock_bh(&sk->sk_lock.slock); | ||
1032 | } | 1044 | } |
1033 | 1045 | ||
1034 | static inline void unlock_sock_bh(struct sock *sk) | ||
1035 | { | ||
1036 | spin_unlock_bh(&sk->sk_lock.slock); | ||
1037 | } | ||
1038 | 1046 | ||
1039 | extern struct sock *sk_alloc(struct net *net, int family, | 1047 | extern struct sock *sk_alloc(struct net *net, int family, |
1040 | gfp_t priority, | 1048 | gfp_t priority, |
@@ -1074,6 +1082,14 @@ extern void *sock_kmalloc(struct sock *sk, int size, | |||
1074 | extern void sock_kfree_s(struct sock *sk, void *mem, int size); | 1082 | extern void sock_kfree_s(struct sock *sk, void *mem, int size); |
1075 | extern void sk_send_sigurg(struct sock *sk); | 1083 | extern void sk_send_sigurg(struct sock *sk); |
1076 | 1084 | ||
1085 | #ifdef CONFIG_CGROUPS | ||
1086 | extern void sock_update_classid(struct sock *sk); | ||
1087 | #else | ||
1088 | static inline void sock_update_classid(struct sock *sk) | ||
1089 | { | ||
1090 | } | ||
1091 | #endif | ||
1092 | |||
1077 | /* | 1093 | /* |
1078 | * Functions to fill in entries in struct proto_ops when a protocol | 1094 | * Functions to fill in entries in struct proto_ops when a protocol |
1079 | * does not implement a particular function. | 1095 | * does not implement a particular function. |
@@ -1404,7 +1420,7 @@ static inline int sk_has_allocations(const struct sock *sk) | |||
1404 | 1420 | ||
1405 | /** | 1421 | /** |
1406 | * wq_has_sleeper - check if there are any waiting processes | 1422 | * wq_has_sleeper - check if there are any waiting processes |
1407 | * @sk: struct socket_wq | 1423 | * @wq: struct socket_wq |
1408 | * | 1424 | * |
1409 | * Returns true if socket_wq has waiting processes | 1425 | * Returns true if socket_wq has waiting processes |
1410 | * | 1426 | * |