From 064989983a5c0b0af3943d37c80f102710aeec6f Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 11 Feb 2003 13:13:10 +0000 Subject: Don't short-circuit zero-length requests of they are BIO_[SG]ETATTR. --- sys/geom/geom_io.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'sys/geom/geom_io.c') diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c index f334817..85ffe33 100644 --- a/sys/geom/geom_io.c +++ b/sys/geom/geom_io.c @@ -393,16 +393,24 @@ g_io_schedule_down(struct thread *tp __unused) g_io_deliver(bp, error); continue; } - /* Truncate requests to the end of providers media. */ - excess = bp->bio_offset + bp->bio_length; - if (excess > bp->bio_to->mediasize) { - excess -= bp->bio_to->mediasize; - bp->bio_length -= excess; - } - /* Deliver zero length transfers right here. */ - if (bp->bio_length == 0) { - g_io_deliver(bp, 0); - continue; + switch (bp->bio_cmd) { + case BIO_READ: + case BIO_WRITE: + case BIO_DELETE: + /* Truncate requests to the end of providers media. */ + excess = bp->bio_offset + bp->bio_length; + if (excess > bp->bio_to->mediasize) { + excess -= bp->bio_to->mediasize; + bp->bio_length -= excess; + } + /* Deliver zero length transfers right here. */ + if (bp->bio_length == 0) { + g_io_deliver(bp, 0); + continue; + } + break; + default: + break; } bp->bio_to->geom->start(bp); if (pace) { -- cgit v1.1