summaryrefslogtreecommitdiffstats
path: root/block/genhd.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2017-08-08 19:49:47 -0400
committerJens Axboe <axboe@kernel.dk>2017-08-09 15:09:20 -0400
commit0609e0efc5e15195ecf8c6d2f2e890d98760e337 (patch)
tree375a8c090f2b2022de3339bc3960e95b3878de7a /block/genhd.c
parentd62e26b3ffd28f16ddae85a1babd0303a1a6dfb6 (diff)
block: make part_in_flight() take an array of two ints
Instead of returning the count that matches the partition, pass in an array of two ints. Index 0 will be filled with the inflight count for the partition in question, and index 1 will filled with the root inflight count, if the partition passed in is not the root. This is in preparation for being able to calculate both in one go. Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com> Reviewed-by: Omar Sandoval <osandov@fb.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/genhd.c')
-rw-r--r--block/genhd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/block/genhd.c b/block/genhd.c
index f735af67a0c9..822f65f95e2a 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1204,6 +1204,7 @@ static int diskstats_show(struct seq_file *seqf, void *v)
1204 struct disk_part_iter piter; 1204 struct disk_part_iter piter;
1205 struct hd_struct *hd; 1205 struct hd_struct *hd;
1206 char buf[BDEVNAME_SIZE]; 1206 char buf[BDEVNAME_SIZE];
1207 unsigned int inflight[2];
1207 int cpu; 1208 int cpu;
1208 1209
1209 /* 1210 /*
@@ -1219,6 +1220,7 @@ static int diskstats_show(struct seq_file *seqf, void *v)
1219 cpu = part_stat_lock(); 1220 cpu = part_stat_lock();
1220 part_round_stats(gp->queue, cpu, hd); 1221 part_round_stats(gp->queue, cpu, hd);
1221 part_stat_unlock(); 1222 part_stat_unlock();
1223 part_in_flight(gp->queue, hd, inflight);
1222 seq_printf(seqf, "%4d %7d %s %lu %lu %lu " 1224 seq_printf(seqf, "%4d %7d %s %lu %lu %lu "
1223 "%u %lu %lu %lu %u %u %u %u\n", 1225 "%u %lu %lu %lu %u %u %u %u\n",
1224 MAJOR(part_devt(hd)), MINOR(part_devt(hd)), 1226 MAJOR(part_devt(hd)), MINOR(part_devt(hd)),
@@ -1231,7 +1233,7 @@ static int diskstats_show(struct seq_file *seqf, void *v)
1231 part_stat_read(hd, merges[WRITE]), 1233 part_stat_read(hd, merges[WRITE]),
1232 part_stat_read(hd, sectors[WRITE]), 1234 part_stat_read(hd, sectors[WRITE]),
1233 jiffies_to_msecs(part_stat_read(hd, ticks[WRITE])), 1235 jiffies_to_msecs(part_stat_read(hd, ticks[WRITE])),
1234 part_in_flight(gp->queue, hd), 1236 inflight[0],
1235 jiffies_to_msecs(part_stat_read(hd, io_ticks)), 1237 jiffies_to_msecs(part_stat_read(hd, io_ticks)),
1236 jiffies_to_msecs(part_stat_read(hd, time_in_queue)) 1238 jiffies_to_msecs(part_stat_read(hd, time_in_queue))
1237 ); 1239 );