diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2005-10-07 02:46:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-08 18:00:57 -0400 |
commit | dd0fc66fb33cd610bc1a5db8a5e232d34879b4d7 (patch) | |
tree | 51f96a9db96293b352e358f66032e1f4ff79fafb /include/net/sock.h | |
parent | 3b0e77bd144203a507eb191f7117d2c5004ea1de (diff) |
[PATCH] gfp flags annotations - part 1
- added typedef unsigned int __nocast gfp_t;
- replaced __nocast uses for gfp flags with gfp_t - it gives exactly
the same warnings as far as sparse is concerned, doesn't change
generated code (from gcc point of view we replaced unsigned int with
typedef) and documents what's going on far better.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index b6440805c420..ecb75526cba0 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -739,18 +739,18 @@ extern void FASTCALL(release_sock(struct sock *sk)); | |||
739 | #define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock)) | 739 | #define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock)) |
740 | 740 | ||
741 | extern struct sock *sk_alloc(int family, | 741 | extern struct sock *sk_alloc(int family, |
742 | unsigned int __nocast priority, | 742 | gfp_t priority, |
743 | struct proto *prot, int zero_it); | 743 | struct proto *prot, int zero_it); |
744 | extern void sk_free(struct sock *sk); | 744 | extern void sk_free(struct sock *sk); |
745 | extern struct sock *sk_clone(const struct sock *sk, | 745 | extern struct sock *sk_clone(const struct sock *sk, |
746 | const unsigned int __nocast priority); | 746 | const gfp_t priority); |
747 | 747 | ||
748 | extern struct sk_buff *sock_wmalloc(struct sock *sk, | 748 | extern struct sk_buff *sock_wmalloc(struct sock *sk, |
749 | unsigned long size, int force, | 749 | unsigned long size, int force, |
750 | unsigned int __nocast priority); | 750 | gfp_t priority); |
751 | extern struct sk_buff *sock_rmalloc(struct sock *sk, | 751 | extern struct sk_buff *sock_rmalloc(struct sock *sk, |
752 | unsigned long size, int force, | 752 | unsigned long size, int force, |
753 | unsigned int __nocast priority); | 753 | gfp_t priority); |
754 | extern void sock_wfree(struct sk_buff *skb); | 754 | extern void sock_wfree(struct sk_buff *skb); |
755 | extern void sock_rfree(struct sk_buff *skb); | 755 | extern void sock_rfree(struct sk_buff *skb); |
756 | 756 | ||
@@ -766,7 +766,7 @@ extern struct sk_buff *sock_alloc_send_skb(struct sock *sk, | |||
766 | int noblock, | 766 | int noblock, |
767 | int *errcode); | 767 | int *errcode); |
768 | extern void *sock_kmalloc(struct sock *sk, int size, | 768 | extern void *sock_kmalloc(struct sock *sk, int size, |
769 | unsigned int __nocast priority); | 769 | gfp_t priority); |
770 | 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); |
771 | extern void sk_send_sigurg(struct sock *sk); | 771 | extern void sk_send_sigurg(struct sock *sk); |
772 | 772 | ||
@@ -1201,7 +1201,7 @@ static inline void sk_stream_moderate_sndbuf(struct sock *sk) | |||
1201 | 1201 | ||
1202 | 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, |
1203 | int size, int mem, | 1203 | int size, int mem, |
1204 | unsigned int __nocast gfp) | 1204 | gfp_t gfp) |
1205 | { | 1205 | { |
1206 | struct sk_buff *skb; | 1206 | struct sk_buff *skb; |
1207 | int hdr_len; | 1207 | int hdr_len; |
@@ -1224,7 +1224,7 @@ static inline struct sk_buff *sk_stream_alloc_pskb(struct sock *sk, | |||
1224 | 1224 | ||
1225 | 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, |
1226 | int size, | 1226 | int size, |
1227 | unsigned int __nocast gfp) | 1227 | gfp_t gfp) |
1228 | { | 1228 | { |
1229 | return sk_stream_alloc_pskb(sk, size, 0, gfp); | 1229 | return sk_stream_alloc_pskb(sk, size, 0, gfp); |
1230 | } | 1230 | } |
@@ -1255,7 +1255,7 @@ static inline int sock_writeable(const struct sock *sk) | |||
1255 | return atomic_read(&sk->sk_wmem_alloc) < (sk->sk_sndbuf / 2); | 1255 | return atomic_read(&sk->sk_wmem_alloc) < (sk->sk_sndbuf / 2); |
1256 | } | 1256 | } |
1257 | 1257 | ||
1258 | static inline unsigned int __nocast gfp_any(void) | 1258 | static inline gfp_t gfp_any(void) |
1259 | { | 1259 | { |
1260 | return in_softirq() ? GFP_ATOMIC : GFP_KERNEL; | 1260 | return in_softirq() ? GFP_ATOMIC : GFP_KERNEL; |
1261 | } | 1261 | } |