diff options
| author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-01 15:09:33 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-01 15:09:33 -0400 |
| commit | 54866f032307063776b4eff7eadb131d47f9f9b4 (patch) | |
| tree | 5fb7b5f886b43fbe115e81c14570c40c44956b53 | |
| parent | b4d367fb20ed19be4a53fa88b407248aeb8bd461 (diff) | |
| parent | 49259d34c52df6be482fefca946debe28ba9a2f6 (diff) | |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[IRDA] IRNET: Fix build when TCGETS2 is defined.
[NET]: docbook fixes for netif_ functions
[NET]: Hide the net_ns kmem cache
[NET]: Mark the setup_net as __net_init
[NET]: Hide the dead code in the net_namespace.c
[NET]: Relax the reference counting of init_net_ns
[NETNS]: Make the init/exit hooks checks outside the loop
[NET]: Forget the zero_it argument of sk_alloc()
[NET]: Remove bogus zero_it argument from sk_alloc
[NET]: Make the sk_clone() lighter
[NET]: Move some core sock setup into sk_prot_alloc
[NET]: Auto-zero the allocated sock object
[NET]: Cleanup the allocation/freeing of the sock object
[NET]: Move the get_net() from sock_copy()
[NET]: Move the sock_copy() from the header
[TCP]: Another TAGBITS -> SACKED_ACKED|LOST conversion
[TCP]: Process DSACKs that reside within a SACK block
39 files changed, 280 insertions, 176 deletions
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index 8936ed3469cf..a005d8f4c38e 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
| @@ -491,7 +491,7 @@ static int pppoe_create(struct net *net, struct socket *sock) | |||
| 491 | int error = -ENOMEM; | 491 | int error = -ENOMEM; |
| 492 | struct sock *sk; | 492 | struct sock *sk; |
| 493 | 493 | ||
| 494 | sk = sk_alloc(net, PF_PPPOX, GFP_KERNEL, &pppoe_sk_proto, 1); | 494 | sk = sk_alloc(net, PF_PPPOX, GFP_KERNEL, &pppoe_sk_proto); |
| 495 | if (!sk) | 495 | if (!sk) |
| 496 | goto out; | 496 | goto out; |
| 497 | 497 | ||
diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c index 921d4ef6d14b..f8904fd92369 100644 --- a/drivers/net/pppol2tp.c +++ b/drivers/net/pppol2tp.c | |||
| @@ -1416,7 +1416,7 @@ static int pppol2tp_create(struct net *net, struct socket *sock) | |||
| 1416 | int error = -ENOMEM; | 1416 | int error = -ENOMEM; |
| 1417 | struct sock *sk; | 1417 | struct sock *sk; |
| 1418 | 1418 | ||
| 1419 | sk = sk_alloc(net, PF_PPPOX, GFP_KERNEL, &pppol2tp_sk_proto, 1); | 1419 | sk = sk_alloc(net, PF_PPPOX, GFP_KERNEL, &pppol2tp_sk_proto); |
| 1420 | if (!sk) | 1420 | if (!sk) |
| 1421 | goto out; | 1421 | goto out; |
| 1422 | 1422 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 9b0c8f12373e..1e6af4f174b6 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -739,6 +739,16 @@ static inline void *netdev_priv(const struct net_device *dev) | |||
| 739 | */ | 739 | */ |
| 740 | #define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev)) | 740 | #define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev)) |
| 741 | 741 | ||
| 742 | /** | ||
| 743 | * netif_napi_add - initialize a napi context | ||
| 744 | * @dev: network device | ||
| 745 | * @napi: napi context | ||
| 746 | * @poll: polling function | ||
| 747 | * @weight: default weight | ||
| 748 | * | ||
| 749 | * netif_napi_add() must be used to initialize a napi context prior to calling | ||
| 750 | * *any* of the other napi related functions. | ||
| 751 | */ | ||
| 742 | static inline void netif_napi_add(struct net_device *dev, | 752 | static inline void netif_napi_add(struct net_device *dev, |
| 743 | struct napi_struct *napi, | 753 | struct napi_struct *napi, |
| 744 | int (*poll)(struct napi_struct *, int), | 754 | int (*poll)(struct napi_struct *, int), |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 5279466606d2..1fd449a6530b 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
| @@ -51,13 +51,12 @@ static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns) | |||
| 51 | } | 51 | } |
| 52 | #endif | 52 | #endif |
| 53 | 53 | ||
| 54 | #ifdef CONFIG_NET_NS | ||
| 54 | extern void __put_net(struct net *net); | 55 | extern void __put_net(struct net *net); |
| 55 | 56 | ||
| 56 | static inline struct net *get_net(struct net *net) | 57 | static inline struct net *get_net(struct net *net) |
| 57 | { | 58 | { |
| 58 | #ifdef CONFIG_NET | ||
| 59 | atomic_inc(&net->count); | 59 | atomic_inc(&net->count); |
| 60 | #endif | ||
| 61 | return net; | 60 | return net; |
| 62 | } | 61 | } |
| 63 | 62 | ||
| @@ -75,26 +74,44 @@ static inline struct net *maybe_get_net(struct net *net) | |||
| 75 | 74 | ||
| 76 | static inline void put_net(struct net *net) | 75 | static inline void put_net(struct net *net) |
| 77 | { | 76 | { |
| 78 | #ifdef CONFIG_NET | ||
| 79 | if (atomic_dec_and_test(&net->count)) | 77 | if (atomic_dec_and_test(&net->count)) |
| 80 | __put_net(net); | 78 | __put_net(net); |
| 81 | #endif | ||
| 82 | } | 79 | } |
| 83 | 80 | ||
| 84 | static inline struct net *hold_net(struct net *net) | 81 | static inline struct net *hold_net(struct net *net) |
| 85 | { | 82 | { |
| 86 | #ifdef CONFIG_NET | ||
| 87 | atomic_inc(&net->use_count); | 83 | atomic_inc(&net->use_count); |
| 88 | #endif | ||
| 89 | return net; | 84 | return net; |
| 90 | } | 85 | } |
| 91 | 86 | ||
| 92 | static inline void release_net(struct net *net) | 87 | static inline void release_net(struct net *net) |
| 93 | { | 88 | { |
| 94 | #ifdef CONFIG_NET | ||
| 95 | atomic_dec(&net->use_count); | 89 | atomic_dec(&net->use_count); |
| 96 | #endif | ||
| 97 | } | 90 | } |
| 91 | #else | ||
| 92 | static inline struct net *get_net(struct net *net) | ||
| 93 | { | ||
| 94 | return net; | ||
| 95 | } | ||
| 96 | |||
| 97 | static inline void put_net(struct net *net) | ||
| 98 | { | ||
| 99 | } | ||
| 100 | |||
| 101 | static inline struct net *hold_net(struct net *net) | ||
| 102 | { | ||
| 103 | return net; | ||
| 104 | } | ||
| 105 | |||
| 106 | static inline void release_net(struct net *net) | ||
| 107 | { | ||
| 108 | } | ||
| 109 | |||
| 110 | static inline struct net *maybe_get_net(struct net *net) | ||
| 111 | { | ||
| 112 | return net; | ||
| 113 | } | ||
| 114 | #endif | ||
| 98 | 115 | ||
| 99 | #define for_each_net(VAR) \ | 116 | #define for_each_net(VAR) \ |
| 100 | list_for_each_entry(VAR, &net_namespace_list, list) | 117 | list_for_each_entry(VAR, &net_namespace_list, list) |
diff --git a/include/net/sock.h b/include/net/sock.h index 43fc3fa50d62..20de3fa7ae40 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -779,7 +779,7 @@ extern void FASTCALL(release_sock(struct sock *sk)); | |||
| 779 | 779 | ||
| 780 | extern struct sock *sk_alloc(struct net *net, int family, | 780 | extern struct sock *sk_alloc(struct net *net, int family, |
| 781 | gfp_t priority, | 781 | gfp_t priority, |
