Skip to content
Snippets Groups Projects
Commit 1d44eb79 authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

zfs: support cache flushes in vdev_disk

parent 865d5138
No related branches found
No related tags found
No related merge requests found
...@@ -145,6 +145,24 @@ vdev_disk_start_bio(zio_t *zio) ...@@ -145,6 +145,24 @@ vdev_disk_start_bio(zio_t *zio)
return ZIO_PIPELINE_STOP; return ZIO_PIPELINE_STOP;
} }
static int
vdev_disk_start_flush(zio_t *zio)
{
vdev_t *vd = zio->io_vd;
struct vdev_disk *dvd = vd->vdev_tsd;
struct bio *bio;
bio = alloc_bio();
bio->bio_cmd = BIO_FLUSH;
bio->bio_dev = dvd->device;
bio->bio_caller1 = zio;
bio->bio_done = vdev_disk_bio_done;
bio->bio_dev->driver->devops->strategy(bio);
return ZIO_PIPELINE_STOP;
}
static int static int
vdev_disk_start_ioctl(zio_t *zio) vdev_disk_start_ioctl(zio_t *zio)
{ {
...@@ -152,7 +170,7 @@ vdev_disk_start_ioctl(zio_t *zio) ...@@ -152,7 +170,7 @@ vdev_disk_start_ioctl(zio_t *zio)
switch (zio->io_cmd) { switch (zio->io_cmd) {
case DKIOCFLUSHWRITECACHE: case DKIOCFLUSHWRITECACHE:
if (1 || zfs_nocacheflush) { if (zfs_nocacheflush) {
kprintf("DKIOCFLUSHWRITECACHE ignored\n"); kprintf("DKIOCFLUSHWRITECACHE ignored\n");
break; break;
} }
...@@ -161,10 +179,7 @@ vdev_disk_start_ioctl(zio_t *zio) ...@@ -161,10 +179,7 @@ vdev_disk_start_ioctl(zio_t *zio)
break; break;
} }
kprintf("DKIOCFLUSHWRITECACHE used\n"); return vdev_disk_start_flush(zio);
abort();
break;
default: default:
zio->io_error = ENOTSUP; zio->io_error = ENOTSUP;
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment