aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw
diff options
context:
space:
mode:
authorMotohiro KOSAKI <kosaki.motohiro@jp.fujitsu.com>2011-05-18 21:07:05 -0400
committerRoland Dreier <roland@purestorage.com>2011-07-18 14:56:03 -0400
commit0cd85e6738976b753fb156d833c94083418b3ae4 (patch)
tree058c4f53a5f0dda8d3893681524609c23770406b /drivers/infiniband/hw
parent52a09a040dc258ca9eb4fa6530e52ccdbc72e353 (diff)
IB/qib: Convert old cpumask api into new one
Adapt to use new APIs. We plan to remove old one later and plan to change current->cpus_allowed implementation. No functional change. Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Acked-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r--drivers/infiniband/hw/qib/qib_file_ops.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/qib/qib_file_ops.c b/drivers/infiniband/hw/qib/qib_file_ops.c
index 406fca50d036..a94a46001745 100644
--- a/drivers/infiniband/hw/qib/qib_file_ops.c
+++ b/drivers/infiniband/hw/qib/qib_file_ops.c
@@ -1527,6 +1527,7 @@ done_chk_sdma:
1527 struct qib_filedata *fd = fp->private_data; 1527 struct qib_filedata *fd = fp->private_data;
1528 const struct qib_ctxtdata *rcd = fd->rcd; 1528 const struct qib_ctxtdata *rcd = fd->rcd;
1529 const struct qib_devdata *dd = rcd->dd; 1529 const struct qib_devdata *dd = rcd->dd;
1530 unsigned int weight;
1530 1531
1531 if (dd->flags & QIB_HAS_SEND_DMA) { 1532 if (dd->flags & QIB_HAS_SEND_DMA) {
1532 fd->pq = qib_user_sdma_queue_create(&dd->pcidev->dev, 1533 fd->pq = qib_user_sdma_queue_create(&dd->pcidev->dev,
@@ -1545,8 +1546,8 @@ done_chk_sdma:
1545 * it just means that sooner or later we don't recommend 1546 * it just means that sooner or later we don't recommend
1546 * a cpu, and let the scheduler do it's best. 1547 * a cpu, and let the scheduler do it's best.
1547 */ 1548 */
1548 if (!ret && cpus_weight(current->cpus_allowed) >= 1549 weight = cpumask_weight(tsk_cpus_allowed(current));
1549 qib_cpulist_count) { 1550 if (!ret && weight >= qib_cpulist_count) {
1550 int cpu; 1551 int cpu;
1551 cpu = find_first_zero_bit(qib_cpulist, 1552 cpu = find_first_zero_bit(qib_cpulist,
1552 qib_cpulist_count); 1553 qib_cpulist_count);
@@ -1554,13 +1555,13 @@ done_chk_sdma:
1554 __set_bit(cpu, qib_cpulist); 1555 __set_bit(cpu, qib_cpulist);
1555 fd->rec_cpu_num = cpu; 1556 fd->rec_cpu_num = cpu;
1556 } 1557 }
1557 } else if (cpus_weight(current->cpus_allowed) == 1 && 1558 } else if (weight == 1 &&
1558 test_bit(first_cpu(current->cpus_allowed), 1559 test_bit(cpumask_first(tsk_cpus_allowed(current)),
1559 qib_cpulist)) 1560 qib_cpulist))
1560 qib_devinfo(dd->pcidev, "%s PID %u affinity " 1561 qib_devinfo(dd->pcidev, "%s PID %u affinity "
1561 "set to cpu %d; already allocated\n", 1562 "set to cpu %d; already allocated\n",
1562 current->comm, current->pid, 1563 current->comm, current->pid,
1563 first_cpu(current->cpus_allowed)); 1564 cpumask_first(tsk_cpus_allowed(current)));
1564 } 1565 }
1565 1566
1566 mutex_unlock(&qib_mutex); 1567 mutex_unlock(&qib_mutex);