diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-07-19 06:48:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-19 18:12:51 -0400 |
commit | d6d9ca0fec6aea0f2e4064474a1c5cdbed873c63 (patch) | |
tree | 0dcf812c45daf1c79087fc1ac365dcbce2485608 /net/core | |
parent | 492c5d943d6a04b124ba3a719dc746dc36b14cfb (diff) |
net: this_cpu_xxx conversions
Use modern this_cpu_xxx() api, saving few bytes on x86
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/sock.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 363bc260157c..b05b9b6ddb87 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -2232,8 +2232,7 @@ static DECLARE_BITMAP(proto_inuse_idx, PROTO_INUSE_NR); | |||
2232 | #ifdef CONFIG_NET_NS | 2232 | #ifdef CONFIG_NET_NS |
2233 | void sock_prot_inuse_add(struct net *net, struct proto *prot, int val) | 2233 | void sock_prot_inuse_add(struct net *net, struct proto *prot, int val) |
2234 | { | 2234 | { |
2235 | int cpu = smp_processor_id(); | 2235 | __this_cpu_add(net->core.inuse->val[prot->inuse_idx], val); |
2236 | per_cpu_ptr(net->core.inuse, cpu)->val[prot->inuse_idx] += val; | ||
2237 | } | 2236 | } |
2238 | EXPORT_SYMBOL_GPL(sock_prot_inuse_add); | 2237 | EXPORT_SYMBOL_GPL(sock_prot_inuse_add); |
2239 | 2238 | ||
@@ -2279,7 +2278,7 @@ static DEFINE_PER_CPU(struct prot_inuse, prot_inuse); | |||
2279 | 2278 | ||
2280 | void sock_prot_inuse_add(struct net *net, struct proto *prot, int val) | 2279 | void sock_prot_inuse_add(struct net *net, struct proto *prot, int val) |
2281 | { | 2280 | { |
2282 | __get_cpu_var(prot_inuse).val[prot->inuse_idx] += val; | 2281 | __this_cpu_add(prot_inuse.val[prot->inuse_idx], val); |
2283 | } | 2282 | } |
2284 | EXPORT_SYMBOL_GPL(sock_prot_inuse_add); | 2283 | EXPORT_SYMBOL_GPL(sock_prot_inuse_add); |
2285 | 2284 | ||