Enable /proc/diskstats for zvols

The /proc/diskstats accounting needs to be explicitly enabled
for block devices which do not use multi-queue.

Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #12440
Closes #12066
This commit is contained in:
Brian Behlendorf 2021-08-05 14:35:34 -07:00 committed by GitHub
parent e1870be450
commit ae1e40b329
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -837,6 +837,9 @@ zvol_alloc(dev_t dev, const char *name)
/* Disable write merging in favor of the ZIO pipeline. */ /* Disable write merging in favor of the ZIO pipeline. */
blk_queue_flag_set(QUEUE_FLAG_NOMERGES, zso->zvo_queue); blk_queue_flag_set(QUEUE_FLAG_NOMERGES, zso->zvo_queue);
/* Enable /proc/diskstats */
blk_queue_flag_set(QUEUE_FLAG_IO_STAT, zso->zvo_queue);
zso->zvo_queue->queuedata = zv; zso->zvo_queue->queuedata = zv;
zso->zvo_dev = dev; zso->zvo_dev = dev;
zv->zv_open_count = 0; zv->zv_open_count = 0;