diff options
Diffstat (limited to 'include/net/sock.h')
| -rw-r--r-- | include/net/sock.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 8c48fbecb7cf..ecb75526cba0 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -99,6 +99,7 @@ struct proto; | |||
| 99 | * @skc_node: main hash linkage for various protocol lookup tables | 99 | * @skc_node: main hash linkage for various protocol lookup tables |
| 100 | * @skc_bind_node: bind hash linkage for various protocol lookup tables | 100 | * @skc_bind_node: bind hash linkage for various protocol lookup tables |
| 101 | * @skc_refcnt: reference count | 101 | * @skc_refcnt: reference count |
| 102 | * @skc_hash: hash value used with various protocol lookup tables | ||
| 102 | * @skc_prot: protocol handlers inside a network family | 103 | * @skc_prot: protocol handlers inside a network family |
| 103 | * | 104 | * |
| 104 | * This is the minimal network layer representation of sockets, the header | 105 | * This is the minimal network layer representation of sockets, the header |
| @@ -112,6 +113,7 @@ struct sock_common { | |||
| 112 | struct hlist_node skc_node; | 113 | struct hlist_node skc_node; |
| 113 | struct hlist_node skc_bind_node; | 114 | struct hlist_node skc_bind_node; |
| 114 | atomic_t skc_refcnt; | 115 | atomic_t skc_refcnt; |
| 116 | unsigned int skc_hash; | ||
| 115 | struct proto *skc_prot; | 117 | struct proto *skc_prot; |
| 116 | }; | 118 | }; |
| 117 | 119 | ||
| @@ -139,7 +141,6 @@ struct sock_common { | |||
| 139 | * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets | 141 | * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets |
| 140 | * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO) | 142 | * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO) |
| 141 | * @sk_lingertime: %SO_LINGER l_linger setting | 143 | * @sk_lingertime: %SO_LINGER l_linger setting |
| 142 | * @sk_hashent: hash entry in several tables (e.g. inet_hashinfo.ehash) | ||
| 143 | * @sk_backlog: always used with the per-socket spinlock held | 144 | * @sk_backlog: always used with the per-socket spinlock held |
| 144 | * @sk_callback_lock: used with the callbacks in the end of this struct | 145 | * @sk_callback_lock: used with the callbacks in the end of this struct |
| 145 | * @sk_error_queue: rarely used | 146 | * @sk_error_queue: rarely used |
| @@ -186,6 +187,7 @@ struct sock { | |||
| 186 | #define sk_node __sk_common.skc_node | 187 | #define sk_node __sk_common.skc_node |
| 187 | #define sk_bind_node __sk_common.skc_bind_node | 188 | #define sk_bind_node __sk_common.skc_bind_node |
| 188 | #define sk_refcnt __sk_common.skc_refcnt | 189 | #define sk_refcnt __sk_common.skc_refcnt |
| 190 | #define sk_hash __sk_common.skc_hash | ||
| 189 | #define sk_prot __sk_common.skc_prot | 191 | #define sk_prot __sk_common.skc_prot |
| 190 | unsigned char sk_shutdown : 2, | 192 | unsigned char sk_shutdown : 2, |
| 191 | sk_no_check : 2, | 193 | sk_no_check : 2, |
| @@ -208,7 +210,6 @@ struct sock { | |||
| 208 | unsigned int sk_allocation; | 210 | unsigned int sk_allocation; |
| 209 | int sk_sndbuf; | 211 | int sk_sndbuf; |
| 210 | int sk_route_caps; | 212 | int sk_route_caps; |
| 211 | int sk_hashent; | ||
| 212 | unsigned long sk_flags; | 213 | unsigned long sk_flags; |
| 213 | unsigned long sk_lingertime; | 214 | unsigned long sk_lingertime; |
| 214 | /* | 215 | /* |
| @@ -738,18 +739,18 @@ extern void FASTCALL(release_sock(struct sock *sk)); | |||
| 738 | #define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock)) | 739 | #define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock)) |
| 739 | 740 | ||
| 740 | extern struct sock *sk_alloc(int family, | 741 | extern struct sock *sk_alloc(int family, |
| 741 | unsigned int __nocast priority, | 742 | gfp_t priority, |
| 742 | struct proto *prot, int zero_it); | 743 | struct proto *prot, int zero_it); |
| 743 | extern void sk_free(struct sock *sk); | 744 | extern void sk_free(struct sock *sk); |
| 744 | extern struct sock *sk_clone(const struct sock *sk, | 745 | extern struct sock *sk_clone(const struct sock *sk, |
| 745 | const unsigned int __nocast priority); | 746 | const gfp_t priority); |
| 746 | 747 | ||
| 747 | extern struct sk_buff *sock_wmalloc(struct sock *sk, | 748 | extern struct sk_buff *sock_wmalloc(struct sock *sk, |
| 748 | unsigned long size, int force, | 749 | unsigned long size, int force, |
| 749 | unsigned int __nocast priority); | 750 | gfp_t priority); |
| 750 | extern struct sk_buff *sock_rmalloc(struct sock *sk, | 751 | extern struct sk_buff *sock_rmalloc(struct sock *sk, |
| 751 | unsigned long size, int force, | 752 | unsigned long size, int force, |
| 752 | unsigned int __nocast priority); | 753 | gfp_t priority); |
| 753 | extern void sock_wfree(struct sk_buff *skb); | 754 | extern void sock_wfree(struct sk_buff *skb); |
| 754 | extern void sock_rfree(struct sk_buff *skb); | 755 | extern void sock_rfree(struct sk_buff *skb); |
| 755 | 756 | ||
| @@ -765,7 +766,7 @@ extern struct sk_buff *sock_alloc_send_skb(struct sock *sk, | |||
| 765 | int noblock, | 766 | int noblock, |
| 766 | int *errcode); | 767 | int *errcode); |
| 767 | extern void *sock_kmalloc(struct sock *sk, int size, | 768 | extern void *sock_kmalloc(struct sock *sk, int size, |
| 768 | unsigned int __nocast priority); | 769 | gfp_t priority); |
| 769 | extern void sock_kfree_s(struct sock *sk, void *mem, int size); | 770 | extern void sock_kfree_s(struct sock *sk, void *mem, int size); |
| 770 | extern void sk_send_sigurg(struct sock *sk); | 771 | extern void sk_send_sigurg(struct sock *sk); |
| 771 | 772 | ||
| @@ -1200,7 +1201,7 @@ static inline void sk_stream_moderate_sndbuf(struct sock *sk) | |||
| 1200 | 1201 | ||
| 1201 | static inline struct sk_buff *sk_stream_alloc_pskb(struct sock *sk, | 1202 | static inline struct sk_buff *sk_stream_alloc_pskb(struct sock *sk, |
| 1202 | int size, int mem, | 1203 | int size, int mem, |
| 1203 | unsigned int __nocast gfp) | 1204 | gfp_t gfp) |
| 1204 | { | 1205 | { |
| 1205 | struct sk_buff *skb; | 1206 | struct sk_buff *skb; |
| 1206 | int hdr_len; | 1207 | int hdr_len; |
| @@ -1223,7 +1224,7 @@ static inline struct sk_buff *sk_stream_alloc_pskb(struct sock *sk, | |||
| 1223 | 1224 | ||
| 1224 | static inline struct sk_buff *sk_stream_alloc_skb(struct sock *sk, | 1225 | static inline struct sk_buff *sk_stream_alloc_skb(struct sock *sk, |
| 1225 | int size, | 1226 | int size, |
| 1226 | unsigned int __nocast gfp) | 1227 | gfp_t gfp) |
| 1227 | { | 1228 | { |
| 1228 | return sk_stream_alloc_pskb(sk, size, 0, gfp); | 1229 | return sk_stream_alloc_pskb(sk, size, 0, gfp); |
| 1229 | } | 1230 | } |
| @@ -1254,7 +1255,7 @@ static inline int sock_writeable(const struct sock *sk) | |||
| 1254 | return atomic_read(&sk->sk_wmem_alloc) < (sk->sk_sndbuf / 2); | 1255 | return atomic_read(&sk->sk_wmem_alloc) < (sk->sk_sndbuf / 2); |
| 1255 | } | 1256 | } |
| 1256 | 1257 | ||
| 1257 | static inline unsigned int __nocast gfp_any(void) | 1258 | static inline gfp_t gfp_any(void) |
| 1258 | { | 1259 | { |
| 1259 | return in_softirq() ? GFP_ATOMIC : GFP_KERNEL; | 1260 | return in_softirq() ? GFP_ATOMIC : GFP_KERNEL; |
| 1260 | } | 1261 | } |
