diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2009-01-11 00:58:09 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-11 13:12:52 -0500 |
commit | f7df8ed164996cd2c6aca9674388be6ef78d8b37 (patch) | |
tree | cdd2cb084b8aa19f6688b24aefe71d170a8c8c22 /drivers/oprofile/buffer_sync.c | |
parent | fbd59a8d1f7cf325fdb6828659f1fb76631e87b3 (diff) |
cpumask: convert misc driver functions
Impact: use new cpumask API.
Convert misc driver functions to use struct cpumask.
To Do:
- Convert iucv_buffer_cpumask to cpumask_var_t.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Mike Travis <travis@sgi.com>
Acked-by: Dean Nelson <dcn@sgi.com>
Cc: Robert Richter <robert.richter@amd.com>
Cc: oprofile-list@lists.sf.net
Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Chris Wright <chrisw@sous-sol.org>
Cc: virtualization@lists.osdl.org
Cc: xen-devel@lists.xensource.com
Cc: Ursula Braun <ursula.braun@de.ibm.com>
Cc: linux390@de.ibm.com
Cc: linux-s390@vger.kernel.org
Diffstat (limited to 'drivers/oprofile/buffer_sync.c')
-rw-r--r-- | drivers/oprofile/buffer_sync.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c index 9da5a4b81133..c3ea5fa7d05a 100644 --- a/drivers/oprofile/buffer_sync.c +++ b/drivers/oprofile/buffer_sync.c | |||
@@ -38,7 +38,7 @@ | |||
38 | 38 | ||
39 | static LIST_HEAD(dying_tasks); | 39 | static LIST_HEAD(dying_tasks); |
40 | static LIST_HEAD(dead_tasks); | 40 | static LIST_HEAD(dead_tasks); |
41 | static cpumask_t marked_cpus = CPU_MASK_NONE; | 41 | static cpumask_var_t marked_cpus; |
42 | static DEFINE_SPINLOCK(task_mortuary); | 42 | static DEFINE_SPINLOCK(task_mortuary); |
43 | static void process_task_mortuary(void); | 43 | static void process_task_mortuary(void); |
44 | 44 | ||
@@ -456,10 +456,10 @@ static void mark_done(int cpu) | |||
456 | { | 456 | { |
457 | int i; | 457 | int i; |
458 | 458 | ||
459 | cpu_set(cpu, marked_cpus); | 459 | cpumask_set_cpu(cpu, marked_cpus); |
460 | 460 | ||
461 | for_each_online_cpu(i) { | 461 | for_each_online_cpu(i) { |
462 | if (!cpu_isset(i, marked_cpus)) | 462 | if (!cpumask_test_cpu(i, marked_cpus)) |
463 | return; | 463 | return; |
464 | } | 464 | } |
465 | 465 | ||
@@ -468,7 +468,7 @@ static void mark_done(int cpu) | |||
468 | */ | 468 | */ |
469 | process_task_mortuary(); | 469 | process_task_mortuary(); |
470 | 470 | ||
471 | cpus_clear(marked_cpus); | 471 | cpumask_clear(marked_cpus); |
472 | } | 472 | } |
473 | 473 | ||
474 | 474 | ||
@@ -565,6 +565,20 @@ void sync_buffer(int cpu) | |||
565 | mutex_unlock(&buffer_mutex); | 565 | mutex_unlock(&buffer_mutex); |
566 | } | 566 | } |
567 | 567 | ||
568 | int __init buffer_sync_init(void) | ||
569 | { | ||
570 | if (!alloc_cpumask_var(&marked_cpus, GFP_KERNEL)) | ||
571 | return -ENOMEM; | ||
572 | |||
573 | cpumask_clear(marked_cpus); | ||
574 | return 0; | ||
575 | } | ||
576 | |||
577 | void __exit buffer_sync_cleanup(void) | ||
578 | { | ||
579 | free_cpumask_var(marked_cpus); | ||
580 | } | ||
581 | |||
568 | /* The function can be used to add a buffer worth of data directly to | 582 | /* The function can be used to add a buffer worth of data directly to |
569 | * the kernel buffer. The buffer is assumed to be a circular buffer. | 583 | * the kernel buffer. The buffer is assumed to be a circular buffer. |
570 | * Take the entries from index start and end at index end, wrapping | 584 | * Take the entries from index start and end at index end, wrapping |