lkml.org 
[lkml]   [2007]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
From
Subject[rfc 28/45] cpu_alloc: convert network sockets
Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
net/core/sock.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

Index: linux-2.6/net/core/sock.c
===================================================================
--- linux-2.6.orig/net/core/sock.c 2007-11-18 14:38:23.290283038 -0800
+++ linux-2.6/net/core/sock.c 2007-11-18 22:04:47.561605283 -0800
@@ -1809,21 +1809,21 @@ static LIST_HEAD(proto_list);
*/
static void inuse_add(struct proto *prot, int inc)
{
- per_cpu_ptr(prot->inuse_ptr, smp_processor_id())[0] += inc;
+ __CPU_ADD(prot->inuse_ptr[0], inc);
}

static int inuse_get(const struct proto *prot)
{
int res = 0, cpu;
for_each_possible_cpu(cpu)
- res += per_cpu_ptr(prot->inuse_ptr, cpu)[0];
+ res += CPU_PTR(prot->inuse_ptr, cpu)[0];
return res;
}

static int inuse_init(struct proto *prot)
{
if (!prot->inuse_getval || !prot->inuse_add) {
- prot->inuse_ptr = alloc_percpu(int);
+ prot->inuse_ptr = CPU_ALLOC(int, GFP_KERNEL);
if (prot->inuse_ptr == NULL)
return -ENOBUFS;

@@ -1836,7 +1836,7 @@ static int inuse_init(struct proto *prot
static void inuse_fini(struct proto *prot)
{
if (prot->inuse_ptr != NULL) {
- free_percpu(prot->inuse_ptr);
+ CPU_FREE(prot->inuse_ptr);
prot->inuse_ptr = NULL;
prot->inuse_getval = NULL;
prot->inuse_add = NULL;
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-11-20 02:27    [W:0.292 / U:1.240 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site