diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2011-05-12 14:45:09 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-13 14:55:21 -0400 |
commit | f20190302e3e697a166cc28ebef43058749dedda (patch) | |
tree | 125a1caba2f92224c0a7f2ff859f0aa8794c532b | |
parent | 9f6298a6ca38e251aa72a6035a8a36a52cf94536 (diff) |
convert old cpumask API into new one
Adapt new API.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/iucv/iucv.c | 73 |
1 files changed, 37 insertions, 36 deletions
diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c index 6c1483f90b46..a15c01524959 100644 --- a/net/iucv/iucv.c +++ b/net/iucv/iucv.c | |||
@@ -128,8 +128,8 @@ struct iucv_irq_list { | |||
128 | }; | 128 | }; |
129 | 129 | ||
130 | static struct iucv_irq_data *iucv_irq_data[NR_CPUS]; | 130 | static struct iucv_irq_data *iucv_irq_data[NR_CPUS]; |
131 | static cpumask_t iucv_buffer_cpumask = CPU_MASK_NONE; | 131 | static cpumask_t iucv_buffer_cpumask = { CPU_BITS_NONE }; |
132 | static cpumask_t iucv_irq_cpumask = CPU_MASK_NONE; | 132 | static cpumask_t iucv_irq_cpumask = { CPU_BITS_NONE }; |
133 | 133 | ||
134 | /* | 134 | /* |
135 | * Queue of interrupt buffers lock for delivery via the tasklet | 135 | * Queue of interrupt buffers lock for delivery via the tasklet |
@@ -406,7 +406,7 @@ static void iucv_allow_cpu(void *data) | |||
406 | parm->set_mask.ipmask = 0xf8; | 406 | parm->set_mask.ipmask = 0xf8; |
407 | iucv_call_b2f0(IUCV_SETCONTROLMASK, parm); | 407 | iucv_call_b2f0(IUCV_SETCONTROLMASK, parm); |
408 | /* Set indication that iucv interrupts are allowed for this cpu. */ | 408 | /* Set indication that iucv interrupts are allowed for this cpu. */ |
409 | cpu_set(cpu, iucv_irq_cpumask); | 409 | cpumask_set_cpu(cpu, &iucv_irq_cpumask); |
410 | } | 410 | } |
411 | 411 | ||
412 | /** | 412 | /** |
@@ -426,7 +426,7 @@ static void iucv_block_cpu(void *data) | |||
426 | iucv_call_b2f0(IUCV_SETMASK, parm); | 426 | iucv_call_b2f0(IUCV_SETMASK, parm); |
427 | 427 | ||
428 | /* Clear indication that iucv interrupts are allowed for this cpu. */ | 428 | /* Clear indication that iucv interrupts are allowed for this cpu. */ |
429 | cpu_clear(cpu, iucv_irq_cpumask); | 429 | cpumask_clear_cpu(cpu, &iucv_irq_cpumask); |
430 | } | 430 | } |
431 | 431 | ||
432 | /** | 432 | /** |
@@ -451,7 +451,7 @@ static void iucv_block_cpu_almost(void *data) | |||
451 | iucv_call_b2f0(IUCV_SETCONTROLMASK, parm); | 451 | iucv_call_b2f0(IUCV_SETCONTROLMASK, parm); |
452 | 452 | ||
453 | /* Clear indication that iucv interrupts are allowed for this cpu. */ | 453 | /* Clear indication that iucv interrupts are allowed for this cpu. */ |
454 | cpu_clear(cpu, iucv_irq_cpumask); | 454 | cpumask_clear_cpu(cpu, &iucv_irq_cpumask); |
455 | } | 455 | } |
456 | 456 | ||
457 | /** | 457 | /** |
@@ -466,7 +466,7 @@ static void iucv_declare_cpu(void *data) | |||
466 | union iucv_param *parm; | 466 | union iucv_param *parm; |
467 | int rc; | 467 | int rc; |
468 | 468 | ||
469 | if (cpu_isset(cpu, iucv_buffer_cpumask)) | 469 | if (cpumask_test_cpu(cpu, &iucv_buffer_cpumask)) |
470 | return; | 470 | return; |
471 | 471 | ||
472 | /* Declare interrupt buffer. */ | 472 | /* Declare interrupt buffer. */ |
@@ -499,9 +499,9 @@ static void iucv_declare_cpu(void *data) | |||
499 | } | 499 | } |
500 | 500 | ||
501 | /* Set indication that an iucv buffer exists for this cpu. */ | 501 | /* Set indication that an iucv buffer exists for this cpu. */ |
502 | cpu_set(cpu, iucv_buffer_cpumask); | 502 | cpumask_set_cpu(cpu, &iucv_buffer_cpumask); |
503 | 503 | ||
504 | if (iucv_nonsmp_handler == 0 || cpus_empty(iucv_irq_cpumask)) | 504 | if (iucv_nonsmp_handler == 0 || cpumask_empty(&iucv_irq_cpumask)) |
505 | /* Enable iucv interrupts on this cpu. */ | 505 | /* Enable iucv interrupts on this cpu. */ |
506 | iucv_allow_cpu(NULL); | 506 | iucv_allow_cpu(NULL); |
507 | else | 507 | else |
@@ -520,7 +520,7 @@ static void iucv_retrieve_cpu(void *data) | |||
520 | int cpu = smp_processor_id(); | 520 | int cpu = smp_processor_id(); |
521 | union iucv_param *parm; | 521 | union iucv_param *parm; |
522 | 522 | ||
523 | if (!cpu_isset(cpu, iucv_buffer_cpumask)) | 523 | if (!cpumask_test_cpu(cpu, &iucv_buffer_cpumask)) |
524 | return; | 524 | return; |
525 | 525 | ||
526 | /* Block iucv interrupts. */ | 526 | /* Block iucv interrupts. */ |
@@ -531,7 +531,7 @@ static void iucv_retrieve_cpu(void *data) | |||
531 | iucv_call_b2f0(IUCV_RETRIEVE_BUFFER, parm); | 531 | iucv_call_b2f0(IUCV_RETRIEVE_BUFFER, parm); |
532 | 532 | ||
533 | /* Clear indication that an iucv buffer exists for this cpu. */ | 533 | /* Clear indication that an iucv buffer exists for this cpu. */ |
534 | cpu_clear(cpu, iucv_buffer_cpumask); | 534 | cpumask_clear_cpu(cpu, &iucv_buffer_cpumask); |
535 | } | 535 | } |
536 | 536 | ||
537 | /** | 537 | /** |
@@ -546,8 +546,8 @@ static void iucv_setmask_mp(void) | |||
546 | get_online_cpus(); | 546 | get_online_cpus(); |
547 | for_each_online_cpu(cpu) | 547 | for_each_online_cpu(cpu) |
548 | /* Enable all cpus with a declared buffer. */ | 548 | /* Enable all cpus with a declared buffer. */ |
549 | if (cpu_isset(cpu, iucv_buffer_cpumask) && | 549 | if (cpumask_test_cpu(cpu, &iucv_buffer_cpumask) && |
550 | !cpu_isset(cpu, iucv_irq_cpumask)) | 550 | !cpumask_test_cpu(cpu, &iucv_irq_cpumask)) |
551 | smp_call_function_single(cpu, iucv_allow_cpu, | 551 | smp_call_function_single(cpu, iucv_allow_cpu, |
552 | NULL, 1); | 552 | NULL, 1); |
553 | put_online_cpus(); | 553 | put_online_cpus(); |
@@ -564,9 +564,9 @@ static void iucv_setmask_up(void) | |||
564 | int cpu; | 564 | int cpu; |
565 | 565 | ||
566 | /* Disable all cpu but the first in cpu_irq_cpumask. */ | 566 | /* Disable all cpu but the first in cpu_irq_cpumask. */ |
567 | cpumask = iucv_irq_cpumask; | 567 | cpumask_copy(&cpumask, &iucv_irq_cpumask); |
568 | cpu_clear(first_cpu(iucv_irq_cpumask), cpumask); | 568 | cpumask_clear_cpu(cpumask_first(&iucv_irq_cpumask), &cpumask); |
569 | for_each_cpu_mask_nr(cpu, cpumask) | 569 | for_each_cpu(cpu, &cpumask) |
570 | smp_call_function_single(cpu, iucv_block_cpu, NULL, 1); | 570 | smp_call_function_single(cpu, iucv_block_cpu, NULL, 1); |
571 | } | 571 | } |
572 | 572 | ||
@@ -593,7 +593,7 @@ static int iucv_enable(void) | |||
593 | rc = -EIO; | 593 | rc = -EIO; |
594 | for_each_online_cpu(cpu) | 594 | for_each_online_cpu(cpu) |
595 | smp_call_function_single(cpu, iucv_declare_cpu, NULL, 1); | 595 | smp_call_function_single(cpu, iucv_declare_cpu, NULL, 1); |
596 | if (cpus_empty(iucv_buffer_cpumask)) | 596 | if (cpumask_empty(&iucv_buffer_cpumask)) |
597 | /* No cpu could declare an iucv buffer. */ | 597 | /* No cpu could declare an iucv buffer. */ |
598 | goto out; | 598 | goto out; |
599 | put_online_cpus(); | 599 | put_online_cpus(); |
@@ -675,15 +675,16 @@ static int __cpuinit iucv_cpu_notify(struct notifier_block *self, | |||
675 | case CPU_DOWN_PREPARE_FROZEN: | 675 | case CPU_DOWN_PREPARE_FROZEN: |
676 | if (!iucv_path_table) | 676 | if (!iucv_path_table) |
677 | break; | 677 | break; |
678 | cpumask = iucv_buffer_cpumask; | 678 | cpumask_copy(&cpumask, &iucv_buffer_cpumask); |
679 | cpu_clear(cpu, cpumask); | 679 | cpumask_clear_cpu(cpu, &cpumask); |
680 | if (cpus_empty(cpumask)) | 680 | if (cpumask_empty(&cpumask)) |
681 | /* Can't offline last IUCV enabled cpu. */ | 681 | /* Can't offline last IUCV enabled cpu. */ |
682 | return notifier_from_errno(-EINVAL); | 682 | return notifier_from_errno(-EINVAL); |
683 | smp_call_function_single(cpu, iucv_retrieve_cpu, NULL, 1); | 683 | smp_call_function_single(cpu, iucv_retrieve_cpu, NULL, 1); |
684 | if (cpus_empty(iucv_irq_cpumask)) | 684 | if (cpumask_empty(&iucv_irq_cpumask)) |
685 | smp_call_function_single(first_cpu(iucv_buffer_cpumask), | 685 | smp_call_function_single( |
686 | iucv_allow_cpu, NULL, 1); | 686 | cpumask_first(&iucv_buffer_cpumask), |
687 | iucv_allow_cpu, NULL, 1); | ||
687 | break; | 688 | break; |
688 | } | 689 | } |
689 | return NOTIFY_OK; | 690 | return NOTIFY_OK; |
@@ -866,7 +867,7 @@ int iucv_path_accept(struct iucv_path *path, struct iucv_handler *handler, | |||
866 | int rc; | 867 | int rc; |
867 | 868 | ||
868 | local_bh_disable(); | 869 | local_bh_disable(); |
869 | if (cpus_empty(iucv_buffer_cpumask)) { | 870 | if (cpumask_empty(&iucv_buffer_cpumask)) { |
870 | rc = -EIO; | 871 | rc = -EIO; |
871 | goto out; | 872 | goto out; |
872 | } | 873 | } |
@@ -915,7 +916,7 @@ int iucv_path_connect(struct iucv_path *path, struct iucv_handler *handler, | |||
915 | 916 | ||
916 | spin_lock_bh(&iucv_table_lock); | 917 | spin_lock_bh(&iucv_table_lock); |
917 | iucv_cleanup_queue(); | 918 | iucv_cleanup_queue(); |
918 | if (cpus_empty(iucv_buffer_cpumask)) { | 919 | if (cpumask_empty(&iucv_buffer_cpumask)) { |
919 | rc = -EIO; | 920 | rc = -EIO; |
920 | goto out; | 921 | goto out; |
921 | } | 922 | } |
@@ -975,7 +976,7 @@ int iucv_path_quiesce(struct iucv_path *path, u8 userdata[16]) | |||
975 | int rc; | 976 | int rc; |
976 | 977 | ||
977 | local_bh_disable(); | 978 | local_bh_disable(); |
978 | if (cpus_empty(iucv_buffer_cpumask)) { | 979 | if (cpumask_empty(&iucv_buffer_cpumask)) { |
979 | rc = -EIO; | 980 | rc = -EIO; |
980 | goto out; | 981 | goto out; |
981 | } | 982 | } |
@@ -1007,7 +1008,7 @@ int iucv_path_resume(struct iucv_path *path, u8 userdata[16]) | |||
1007 | int rc; | 1008 | int rc; |
1008 | 1009 | ||
1009 | local_bh_disable(); | 1010 | local_bh_disable(); |
1010 | if (cpus_empty(iucv_buffer_cpumask)) { | 1011 | if (cpumask_empty(&iucv_buffer_cpumask)) { |
1011 | rc = -EIO; | 1012 | rc = -EIO; |
1012 | goto out; | 1013 | goto out; |
1013 | } | 1014 | } |
@@ -1036,7 +1037,7 @@ int iucv_path_sever(struct iucv_path *path, u8 userdata[16]) | |||
1036 | int rc; | 1037 | int rc; |
1037 | 1038 | ||
1038 | preempt_disable(); | 1039 | preempt_disable(); |
1039 | if (cpus_empty(iucv_buffer_cpumask)) { | 1040 | if (cpumask_empty(&iucv_buffer_cpumask)) { |
1040 | rc = -EIO; | 1041 | rc = -EIO; |
1041 | goto out; | 1042 | goto out; |
1042 | } | 1043 | } |
@@ -1070,7 +1071,7 @@ int iucv_message_purge(struct iucv_path *path, struct iucv_message *msg, | |||
1070 | int rc; | 1071 | int rc; |
1071 | 1072 | ||
1072 | local_bh_disable(); | 1073 | local_bh_disable(); |
1073 | if (cpus_empty(iucv_buffer_cpumask)) { | 1074 | if (cpumask_empty(&iucv_buffer_cpumask)) { |
1074 | rc = -EIO; | 1075 | rc = -EIO; |
1075 | goto out; | 1076 | goto out; |
1076 | } | 1077 | } |
@@ -1162,7 +1163,7 @@ int __iucv_message_receive(struct iucv_path *path, struct iucv_message *msg, | |||
1162 | if (msg->flags & IUCV_IPRMDATA) | 1163 | if (msg->flags & IUCV_IPRMDATA) |
1163 | return iucv_message_receive_iprmdata(path, msg, flags, | 1164 | return iucv_message_receive_iprmdata(path, msg, flags, |
1164 | buffer, size, residual); | 1165 | buffer, size, residual); |
1165 | if (cpus_empty(iucv_buffer_cpumask)) { | 1166 | if (cpumask_empty(&iucv_buffer_cpumask)) { |
1166 | rc = -EIO; | 1167 | rc = -EIO; |
1167 | goto out; | 1168 | goto out; |
1168 | } | 1169 | } |
@@ -1235,7 +1236,7 @@ int iucv_message_reject(struct iucv_path *path, struct iucv_message *msg) | |||
1235 | int rc; | 1236 | int rc; |
1236 | 1237 | ||
1237 | local_bh_disable(); | 1238 | local_bh_disable(); |
1238 | if (cpus_empty(iucv_buffer_cpumask)) { | 1239 | if (cpumask_empty(&iucv_buffer_cpumask)) { |
1239 | rc = -EIO; | 1240 | rc = -EIO; |
1240 | goto out; | 1241 | goto out; |
1241 | } | 1242 | } |
@@ -1274,7 +1275,7 @@ int iucv_message_reply(struct iucv_path *path, struct iucv_message *msg, | |||
1274 | int rc; | 1275 | int rc; |
1275 | 1276 | ||
1276 | local_bh_disable(); | 1277 | local_bh_disable(); |
1277 | if (cpus_empty(iucv_buffer_cpumask)) { | 1278 | if (cpumask_empty(&iucv_buffer_cpumask)) { |
1278 | rc = -EIO; | 1279 | rc = -EIO; |
1279 | goto out; | 1280 | goto out; |
1280 | } | 1281 | } |
@@ -1324,7 +1325,7 @@ int __iucv_message_send(struct iucv_path *path, struct iucv_message *msg, | |||
1324 | union iucv_param *parm; | 1325 | union iucv_param *parm; |
1325 | int rc; | 1326 | int rc; |
1326 | 1327 | ||
1327 | if (cpus_empty(iucv_buffer_cpumask)) { | 1328 | if (cpumask_empty(&iucv_buffer_cpumask)) { |
1328 | rc = -EIO; | 1329 | rc = -EIO; |
1329 | goto out; | 1330 | goto out; |
1330 | } | 1331 | } |
@@ -1411,7 +1412,7 @@ int iucv_message_send2way(struct iucv_path *path, struct iucv_message *msg, | |||
1411 | int rc; | 1412 | int rc; |
1412 | 1413 | ||
1413 | local_bh_disable(); | 1414 | local_bh_disable(); |
1414 | if (cpus_empty(iucv_buffer_cpumask)) { | 1415 | if (cpumask_empty(&iucv_buffer_cpumask)) { |
1415 | rc = -EIO; | 1416 | rc = -EIO; |
1416 | goto out; | 1417 | goto out; |
1417 | } | 1418 | } |
@@ -1888,7 +1889,7 @@ static int iucv_pm_freeze(struct device *dev) | |||
1888 | printk(KERN_WARNING "iucv_pm_freeze\n"); | 1889 | printk(KERN_WARNING "iucv_pm_freeze\n"); |
1889 | #endif | 1890 | #endif |
1890 | if (iucv_pm_state != IUCV_PM_FREEZING) { | 1891 | if (iucv_pm_state != IUCV_PM_FREEZING) { |
1891 | for_each_cpu_mask_nr(cpu, iucv_irq_cpumask) | 1892 | for_each_cpu(cpu, &iucv_irq_cpumask) |
1892 | smp_call_function_single(cpu, iucv_block_cpu_almost, | 1893 | smp_call_function_single(cpu, iucv_block_cpu_almost, |
1893 | NULL, 1); | 1894 | NULL, 1); |
1894 | cancel_work_sync(&iucv_work); | 1895 | cancel_work_sync(&iucv_work); |
@@ -1928,7 +1929,7 @@ static int iucv_pm_thaw(struct device *dev) | |||
1928 | if (rc) | 1929 | if (rc) |
1929 | goto out; | 1930 | goto out; |
1930 | } | 1931 | } |
1931 | if (cpus_empty(iucv_irq_cpumask)) { | 1932 | if (cpumask_empty(&iucv_irq_cpumask)) { |
1932 | if (iucv_nonsmp_handler) | 1933 | if (iucv_nonsmp_handler) |
1933 | /* enable interrupts on one cpu */ | 1934 | /* enable interrupts on one cpu */ |
1934 | iucv_allow_cpu(NULL); | 1935 | iucv_allow_cpu(NULL); |
@@ -1961,7 +1962,7 @@ static int iucv_pm_restore(struct device *dev) | |||
1961 | pr_warning("Suspending Linux did not completely close all IUCV " | 1962 | pr_warning("Suspending Linux did not completely close all IUCV " |
1962 | "connections\n"); | 1963 | "connections\n"); |
1963 | iucv_pm_state = IUCV_PM_RESTORING; | 1964 | iucv_pm_state = IUCV_PM_RESTORING; |
1964 | if (cpus_empty(iucv_irq_cpumask)) { | 1965 | if (cpumask_empty(&iucv_irq_cpumask)) { |
1965 | rc = iucv_query_maxconn(); | 1966 | rc = iucv_query_maxconn(); |
1966 | rc = iucv_enable(); | 1967 | rc = iucv_enable(); |
1967 | if (rc) | 1968 | if (rc) |