hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/block/blk-mq-pci.c
....@@ -1,14 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Copyright (c) 2016 Christoph Hellwig.
3
- *
4
- * This program is free software; you can redistribute it and/or modify it
5
- * under the terms and conditions of the GNU General Public License,
6
- * version 2, as published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope it will be useful, but WITHOUT
9
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
- * more details.
124 */
135 #include <linux/kobject.h>
146 #include <linux/blkdev.h>
....@@ -21,7 +13,7 @@
2113
2214 /**
2315 * blk_mq_pci_map_queues - provide a default queue mapping for PCI device
24
- * @set: tagset to provide the mapping for
16
+ * @qmap: CPU to hardware queue map.
2517 * @pdev: PCI device associated with @set.
2618 * @offset: Offset to use for the pci irq vector
2719 *
....@@ -31,26 +23,26 @@
3123 * that maps a queue to the CPUs that have irq affinity for the corresponding
3224 * vector.
3325 */
34
-int blk_mq_pci_map_queues(struct blk_mq_tag_set *set, struct pci_dev *pdev,
26
+int blk_mq_pci_map_queues(struct blk_mq_queue_map *qmap, struct pci_dev *pdev,
3527 int offset)
3628 {
3729 const struct cpumask *mask;
3830 unsigned int queue, cpu;
3931
40
- for (queue = 0; queue < set->nr_hw_queues; queue++) {
32
+ for (queue = 0; queue < qmap->nr_queues; queue++) {
4133 mask = pci_irq_get_affinity(pdev, queue + offset);
4234 if (!mask)
4335 goto fallback;
4436
4537 for_each_cpu(cpu, mask)
46
- set->mq_map[cpu] = queue;
38
+ qmap->mq_map[cpu] = qmap->queue_offset + queue;
4739 }
4840
4941 return 0;
5042
5143 fallback:
52
- WARN_ON_ONCE(set->nr_hw_queues > 1);
53
- blk_mq_clear_mq_map(set);
44
+ WARN_ON_ONCE(qmap->nr_queues > 1);
45
+ blk_mq_clear_mq_map(qmap);
5446 return 0;
5547 }
5648 EXPORT_SYMBOL_GPL(blk_mq_pci_map_queues);