Commit b2f609e1 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

block: move the blk-mq calls out of part_in_flight{,_rw}

Don't bother to call part_in_flight / part_in_flight_rw on blk-mq
devices, just call the blk-mq versions directly.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent f1394b79
...@@ -142,14 +142,9 @@ void part_dec_in_flight(struct request_queue *q, struct hd_struct *part, int rw) ...@@ -142,14 +142,9 @@ void part_dec_in_flight(struct request_queue *q, struct hd_struct *part, int rw)
static unsigned int part_in_flight(struct request_queue *q, static unsigned int part_in_flight(struct request_queue *q,
struct hd_struct *part) struct hd_struct *part)
{ {
unsigned int inflight = 0;
int cpu; int cpu;
unsigned int inflight;
if (queue_is_mq(q)) {
return blk_mq_in_flight(q, part);
}
inflight = 0;
for_each_possible_cpu(cpu) { for_each_possible_cpu(cpu) {
inflight += part_stat_local_read_cpu(part, in_flight[0], cpu) + inflight += part_stat_local_read_cpu(part, in_flight[0], cpu) +
part_stat_local_read_cpu(part, in_flight[1], cpu); part_stat_local_read_cpu(part, in_flight[1], cpu);
...@@ -165,11 +160,6 @@ static void part_in_flight_rw(struct request_queue *q, struct hd_struct *part, ...@@ -165,11 +160,6 @@ static void part_in_flight_rw(struct request_queue *q, struct hd_struct *part,
{ {
int cpu; int cpu;
if (queue_is_mq(q)) {
blk_mq_in_flight_rw(q, part, inflight);
return;
}
inflight[0] = 0; inflight[0] = 0;
inflight[1] = 0; inflight[1] = 0;
for_each_possible_cpu(cpu) { for_each_possible_cpu(cpu) {
...@@ -1307,7 +1297,10 @@ ssize_t part_stat_show(struct device *dev, ...@@ -1307,7 +1297,10 @@ ssize_t part_stat_show(struct device *dev,
unsigned int inflight; unsigned int inflight;
part_stat_read_all(p, &stat); part_stat_read_all(p, &stat);
inflight = part_in_flight(q, p); if (queue_is_mq(q))
inflight = blk_mq_in_flight(q, p);
else
inflight = part_in_flight(q, p);
return sprintf(buf, return sprintf(buf,
"%8lu %8lu %8llu %8u " "%8lu %8lu %8llu %8u "
...@@ -1346,7 +1339,11 @@ ssize_t part_inflight_show(struct device *dev, struct device_attribute *attr, ...@@ -1346,7 +1339,11 @@ ssize_t part_inflight_show(struct device *dev, struct device_attribute *attr,
struct request_queue *q = part_to_disk(p)->queue; struct request_queue *q = part_to_disk(p)->queue;
unsigned int inflight[2]; unsigned int inflight[2];
part_in_flight_rw(q, p, inflight); if (queue_is_mq(q))
blk_mq_in_flight_rw(q, p, inflight);
else
part_in_flight_rw(q, p, inflight);
return sprintf(buf, "%8u %8u\n", inflight[0], inflight[1]); return sprintf(buf, "%8u %8u\n", inflight[0], inflight[1]);
} }
...@@ -1601,7 +1598,10 @@ static int diskstats_show(struct seq_file *seqf, void *v) ...@@ -1601,7 +1598,10 @@ static int diskstats_show(struct seq_file *seqf, void *v)
disk_part_iter_init(&piter, gp, DISK_PITER_INCL_EMPTY_PART0); disk_part_iter_init(&piter, gp, DISK_PITER_INCL_EMPTY_PART0);
while ((hd = disk_part_iter_next(&piter))) { while ((hd = disk_part_iter_next(&piter))) {
part_stat_read_all(hd, &stat); part_stat_read_all(hd, &stat);
inflight = part_in_flight(gp->queue, hd); if (queue_is_mq(gp->queue))
inflight = blk_mq_in_flight(gp->queue, hd);
else
inflight = part_in_flight(gp->queue, hd);
seq_printf(seqf, "%4d %7d %s " seq_printf(seqf, "%4d %7d %s "
"%lu %lu %lu %u " "%lu %lu %lu %u "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment