Deleted Added
full compact
28c28
< __FBSDID("$FreeBSD: head/sys/geom/eli/g_eli_privacy.c 214116 2010-10-20 20:01:45Z pjd $");
---
> __FBSDID("$FreeBSD: head/sys/geom/eli/g_eli_privacy.c 214118 2010-10-20 20:50:55Z pjd $");
56c56
< * g_eli_start -> g_io_request -> g_eli_read_done -> g_eli_crypto_run -> g_eli_crypto_read_done -> g_io_deliver
---
> * g_eli_start -> g_eli_crypto_read -> g_io_request -> g_eli_read_done -> g_eli_crypto_run -> g_eli_crypto_read_done -> g_io_deliver
66c66
< * g_eli_start -> g_io_request -> g_eli_read_done -> g_eli_crypto_run -> G_ELI_CRYPTO_READ_DONE -> g_io_deliver
---
> * g_eli_start -> g_eli_crypto_read -> g_io_request -> g_eli_read_done -> g_eli_crypto_run -> G_ELI_CRYPTO_READ_DONE -> g_io_deliver
70a71
> struct g_eli_softc *sc;
103a105
> sc = bp->bio_to->geom->softc;
104a107
> atomic_subtract_int(&sc->sc_inflight, 1);
115a119
> struct g_eli_softc *sc;
143a148
> gp = bp->bio_to->geom;
149a155
> sc = gp->softc;
150a157
> atomic_subtract_int(&sc->sc_inflight, 1);
155d161
< gp = bp->bio_to->geom;
166a173,216
> * The function is called to read encrypted data.
> *
> * g_eli_start -> G_ELI_CRYPTO_READ -> g_io_request -> g_eli_read_done -> g_eli_crypto_run -> g_eli_crypto_read_done -> g_io_deliver
> */
> void
> g_eli_crypto_read(struct g_eli_softc *sc, struct bio *bp, boolean_t fromworker)
> {
> struct g_consumer *cp;
> struct bio *cbp;
>
> if (!fromworker) {
> /*
> * We are not called from the worker thread, so check if
> * device is suspended.
> */
> mtx_lock(&sc->sc_queue_mtx);
> if (sc->sc_flags & G_ELI_FLAG_SUSPEND) {
> /*
> * If device is suspended, we place the request onto
> * the queue, so it can be handled after resume.
> */
> G_ELI_DEBUG(0, "device suspended, move onto queue");
> bioq_insert_tail(&sc->sc_queue, bp);
> mtx_unlock(&sc->sc_queue_mtx);
> wakeup(sc);
> return;
> }
> atomic_add_int(&sc->sc_inflight, 1);
> mtx_unlock(&sc->sc_queue_mtx);
> }
> bp->bio_pflags = 0;
> bp->bio_driver2 = NULL;
> cbp = bp->bio_driver1;
> cbp->bio_done = g_eli_read_done;
> cp = LIST_FIRST(&sc->sc_geom->consumer);
> cbp->bio_to = cp->provider;
> G_ELI_LOGREQ(2, cbp, "Sending request.");
> /*
> * Read encrypted data from provider.
> */
> g_io_request(cbp, cp);
> }
>
> /*
171c221
< * g_eli_start -> g_io_request -> g_eli_read_done -> G_ELI_CRYPTO_RUN -> g_eli_crypto_read_done -> g_io_deliver
---
> * g_eli_start -> g_eli_crypto_read -> g_io_request -> g_eli_read_done -> G_ELI_CRYPTO_RUN -> g_eli_crypto_read_done -> g_io_deliver