Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/gate/g_gate.c
Show First 20 Lines • Show All 279 Lines • ▼ Show 20 Lines | case BIO_READ: | ||||
cbp->bio_offset = pbp->bio_offset + sc->sc_readoffset; | cbp->bio_offset = pbp->bio_offset + sc->sc_readoffset; | ||||
mtx_unlock(&sc->sc_read_mtx); | mtx_unlock(&sc->sc_read_mtx); | ||||
cbp->bio_done = g_gate_done; | cbp->bio_done = g_gate_done; | ||||
g_io_request(cbp, cp); | g_io_request(cbp, cp); | ||||
return; | return; | ||||
case BIO_DELETE: | case BIO_DELETE: | ||||
case BIO_WRITE: | case BIO_WRITE: | ||||
case BIO_FLUSH: | case BIO_FLUSH: | ||||
case BIO_SPEEDUP: | |||||
/* XXX: Hack to allow read-only mounts. */ | /* XXX: Hack to allow read-only mounts. */ | ||||
if ((sc->sc_flags & G_GATE_FLAG_READONLY) != 0) { | if ((sc->sc_flags & G_GATE_FLAG_READONLY) != 0) { | ||||
g_io_deliver(pbp, EPERM); | g_io_deliver(pbp, EPERM); | ||||
return; | return; | ||||
} | } | ||||
break; | break; | ||||
case BIO_GETATTR: | case BIO_GETATTR: | ||||
default: | default: | ||||
▲ Show 20 Lines • Show All 570 Lines • ▼ Show 20 Lines | case G_GATE_CMD_START: | ||||
ggio->gctl_seq = (uintptr_t)bp->bio_driver1; | ggio->gctl_seq = (uintptr_t)bp->bio_driver1; | ||||
ggio->gctl_offset = bp->bio_offset; | ggio->gctl_offset = bp->bio_offset; | ||||
ggio->gctl_length = bp->bio_length; | ggio->gctl_length = bp->bio_length; | ||||
switch (bp->bio_cmd) { | switch (bp->bio_cmd) { | ||||
case BIO_READ: | case BIO_READ: | ||||
case BIO_DELETE: | case BIO_DELETE: | ||||
case BIO_FLUSH: | case BIO_FLUSH: | ||||
case BIO_SPEEDUP: | |||||
break; | break; | ||||
case BIO_WRITE: | case BIO_WRITE: | ||||
error = copyout(bp->bio_data, ggio->gctl_data, | error = copyout(bp->bio_data, ggio->gctl_data, | ||||
bp->bio_length); | bp->bio_length); | ||||
if (error != 0) { | if (error != 0) { | ||||
mtx_lock(&sc->sc_queue_mtx); | mtx_lock(&sc->sc_queue_mtx); | ||||
bioq_remove(&sc->sc_outqueue, bp); | bioq_remove(&sc->sc_outqueue, bp); | ||||
bioq_insert_head(&sc->sc_inqueue, bp); | bioq_insert_head(&sc->sc_inqueue, bp); | ||||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | if (ggio->gctl_error == EAGAIN) { | ||||
error = copyin(ggio->gctl_data, | error = copyin(ggio->gctl_data, | ||||
bp->bio_data, bp->bio_length); | bp->bio_data, bp->bio_length); | ||||
if (error != 0) | if (error != 0) | ||||
bp->bio_error = error; | bp->bio_error = error; | ||||
break; | break; | ||||
case BIO_DELETE: | case BIO_DELETE: | ||||
case BIO_WRITE: | case BIO_WRITE: | ||||
case BIO_FLUSH: | case BIO_FLUSH: | ||||
case BIO_SPEEDUP: | |||||
break; | break; | ||||
} | } | ||||
} | } | ||||
G_GATE_LOGREQ(2, bp, "Request done."); | G_GATE_LOGREQ(2, bp, "Request done."); | ||||
g_io_deliver(bp, bp->bio_error); | g_io_deliver(bp, bp->bio_error); | ||||
} | } | ||||
done_end: | done_end: | ||||
g_gate_release(sc); | g_gate_release(sc); | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |