Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/gate/g_gate.c
Show First 20 Lines • Show All 855 Lines • ▼ Show 20 Lines | for (;;) { | ||||
bp = bioq_first(&sc->sc_inqueue); | bp = bioq_first(&sc->sc_inqueue); | ||||
if (bp != NULL) | if (bp != NULL) | ||||
break; | break; | ||||
if ((sc->sc_flags & G_GATE_FLAG_DESTROY) != 0) { | if ((sc->sc_flags & G_GATE_FLAG_DESTROY) != 0) { | ||||
ggio->gctl_error = ECANCELED; | ggio->gctl_error = ECANCELED; | ||||
mtx_unlock(&sc->sc_queue_mtx); | mtx_unlock(&sc->sc_queue_mtx); | ||||
goto start_end; | goto start_end; | ||||
} | } | ||||
if (msleep(sc, &sc->sc_queue_mtx, | error = msleep(sc, &sc->sc_queue_mtx, | ||||
jo_bruelltuete.com: do you think it's worth it to put a comment here, along the lines of:
"can fail with ERESTART… | |||||
peterjAuthorUnsubmitted Done Inline Actions
It can return either ERESTART or EINTR. The former is transparently handled inside the kernel. The latter will bubble up to userland and cause ggatec to abort (much the same as at present). I don't think the comment would add much value because my patch is altering the behaviour to match normal FreeBSD behaviour of just returning an "error" via the standard error path. The existing code is abnormal because it's bypassing the standard return path. peterj: > do you think it's worth it to put a comment here, along the lines of:
> "can fail with… | |||||
PPAUSE | PDROP | PCATCH, "ggwait", 0) != 0) { | PPAUSE | PDROP | PCATCH, "ggwait", 0); | ||||
ggio->gctl_error = ECANCELED; | if (error != 0) | ||||
goto start_end; | goto start_end; | ||||
} | |||||
} | } | ||||
ggio->gctl_cmd = bp->bio_cmd; | ggio->gctl_cmd = bp->bio_cmd; | ||||
if (bp->bio_cmd == BIO_WRITE && | if (bp->bio_cmd == BIO_WRITE && | ||||
bp->bio_length > ggio->gctl_length) { | bp->bio_length > ggio->gctl_length) { | ||||
mtx_unlock(&sc->sc_queue_mtx); | mtx_unlock(&sc->sc_queue_mtx); | ||||
ggio->gctl_length = bp->bio_length; | ggio->gctl_length = bp->bio_length; | ||||
ggio->gctl_error = ENOMEM; | ggio->gctl_error = ENOMEM; | ||||
goto start_end; | goto start_end; | ||||
▲ Show 20 Lines • Show All 142 Lines • Show Last 20 Lines |
do you think it's worth it to put a comment here, along the lines of:
"can fail with ERESTART, without any negative affect on the ggate instance. ioctl handler will just call this code again automatically".