From 204a4e196a0b29990ecb3564f1bee1eed29dd423 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Mon, 23 May 2011 21:00:37 +0000 Subject: [PATCH] Recognize BIO_FLUSH requests and pass them to userland. MFC after: 1 week --- sys/geom/gate/g_gate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/geom/gate/g_gate.c b/sys/geom/gate/g_gate.c index 9b4d782aa410..22338a513caa 100644 --- a/sys/geom/gate/g_gate.c +++ b/sys/geom/gate/g_gate.c @@ -180,6 +180,7 @@ g_gate_start(struct bio *bp) break; case BIO_DELETE: case BIO_WRITE: + case BIO_FLUSH: /* XXX: Hack to allow read-only mounts. */ if ((sc->sc_flags & G_GATE_FLAG_READONLY) != 0) { g_io_deliver(bp, EPERM); @@ -580,6 +581,7 @@ g_gate_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct threa switch (bp->bio_cmd) { case BIO_READ: case BIO_DELETE: + case BIO_FLUSH: break; case BIO_WRITE: error = copyout(bp->bio_data, ggio->gctl_data, @@ -643,6 +645,7 @@ g_gate_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct threa break; case BIO_DELETE: case BIO_WRITE: + case BIO_FLUSH: break; } }