summaryrefslogtreecommitdiffstats
path: root/module/zfs
diff options
context:
space:
mode:
Diffstat (limited to 'module/zfs')
-rw-r--r--module/zfs/vdev_disk.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/module/zfs/vdev_disk.c b/module/zfs/vdev_disk.c
index 393737377..5697f6867 100644
--- a/module/zfs/vdev_disk.c
+++ b/module/zfs/vdev_disk.c
@@ -520,6 +520,9 @@ __vdev_disk_physio(struct block_device *bdev, zio_t *zio, caddr_t kbuf_ptr,
uint64_t bio_offset;
int bio_size, bio_count = 16;
int i = 0, error = 0;
+#if defined(HAVE_BLK_QUEUE_HAVE_BLK_PLUG)
+ struct blk_plug plug;
+#endif
ASSERT3U(kbuf_offset + kbuf_size, <=, bdev->bd_inode->i_size);
@@ -590,11 +593,21 @@ retry:
if (zio)
zio->io_delay = jiffies_64;
+#if defined(HAVE_BLK_QUEUE_HAVE_BLK_PLUG)
+ if (dr->dr_bio_count > 1)
+ blk_start_plug(&plug);
+#endif
+
/* Submit all bio's associated with this dio */
for (i = 0; i < dr->dr_bio_count; i++)
if (dr->dr_bio[i])
vdev_submit_bio(dr->dr_bio[i]);
+#if defined(HAVE_BLK_QUEUE_HAVE_BLK_PLUG)
+ if (dr->dr_bio_count > 1)
+ blk_finish_plug(&plug);
+#endif
+
(void) vdev_disk_dio_put(dr);
return (error);