aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/sock.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2005-10-07 02:46:04 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-08 18:00:57 -0400
commitdd0fc66fb33cd610bc1a5db8a5e232d34879b4d7 (patch)
tree51f96a9db96293b352e358f66032e1f4ff79fafb /net/core/sock.c
parent3b0e77bd144203a507eb191f7117d2c5004ea1de (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 'net/core/sock.c')
-rw-r--r--net/core/sock.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index 928d2a1d6d8e..1c52fe809eda 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -637,7 +637,7 @@ lenout:
637 * @prot: struct proto associated with this new sock instance 637 * @prot: struct proto associated with this new sock instance
638 * @zero_it: if we should zero the newly allocated sock 638 * @zero_it: if we should zero the newly allocated sock
639 */ 639 */
640struct sock *sk_alloc(int family, unsigned int __nocast priority, 640struct sock *sk_alloc(int family, gfp_t priority,
641 struct proto *prot, int zero_it) 641 struct proto *prot, int zero_it)
642{ 642{
643 struct sock *sk = NULL; 643 struct sock *sk = NULL;
@@ -704,7 +704,7 @@ void sk_free(struct sock *sk)
704 module_put(owner); 704 module_put(owner);
705} 705}
706 706
707struct sock *sk_clone(const struct sock *sk, const unsigned int __nocast priority) 707struct sock *sk_clone(const struct sock *sk, const gfp_t priority)
708{ 708{
709 struct sock *newsk = sk_alloc(sk->sk_family, priority, sk->sk_prot, 0); 709 struct sock *newsk = sk_alloc(sk->sk_family, priority, sk->sk_prot, 0);
710 710
@@ -845,7 +845,7 @@ unsigned long sock_i_ino(struct sock *sk)
845 * Allocate a skb from the socket's send buffer. 845 * Allocate a skb from the socket's send buffer.
846 */ 846 */
847struct sk_buff *sock_wmalloc(struct sock *sk, unsigned long size, int force, 847struct sk_buff *sock_wmalloc(struct sock *sk, unsigned long size, int force,
848 unsigned int __nocast priority) 848 gfp_t priority)
849{ 849{
850 if (force || atomic_read(&sk->sk_wmem_alloc) < sk->sk_sndbuf) { 850 if (force || atomic_read(&sk->sk_wmem_alloc) < sk->sk_sndbuf) {
851 struct sk_buff * skb = alloc_skb(size, priority); 851 struct sk_buff * skb = alloc_skb(size, priority);
@@ -861,7 +861,7 @@ struct sk_buff *sock_wmalloc(struct sock *sk, unsigned long size, int force,
861 * Allocate a skb from the socket's receive buffer. 861 * Allocate a skb from the socket's receive buffer.
862 */ 862 */
863struct sk_buff *sock_rmalloc(struct sock *sk, unsigned long size, int force, 863struct sk_buff *sock_rmalloc(struct sock *sk, unsigned long size, int force,
864 unsigned int __nocast priority) 864 gfp_t priority)
865{ 865{
866 if (force || atomic_read(&sk->sk_rmem_alloc) < sk->sk_rcvbuf) { 866 if (force || atomic_read(&sk->sk_rmem_alloc) < sk->sk_rcvbuf) {
867 struct sk_buff *skb = alloc_skb(size, priority); 867 struct sk_buff *skb = alloc_skb(size, priority);
@@ -876,7 +876,7 @@ struct sk_buff *sock_rmalloc(struct sock *sk, unsigned long size, int force,
876/* 876/*
877 * Allocate a memory block from the socket's option memory buffer. 877 * Allocate a memory block from the socket's option memory buffer.
878 */ 878 */
879void *sock_kmalloc(struct sock *sk, int size, unsigned int __nocast priority) 879void *sock_kmalloc(struct sock *sk, int size, gfp_t priority)
880{ 880{
881 if ((unsigned)size <= sysctl_optmem_max && 881 if ((unsigned)size <= sysctl_optmem_max &&
882 atomic_read(&sk->sk_omem_alloc) + size < sysctl_optmem_max) { 882 atomic_read(&sk->sk_omem_alloc) + size < sysctl_optmem_max) {