FreeBSD/sys/geom/eli/g_eli_privacy.c
/*
 * 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
 */
The function is called to read encrypted data.
The function is called to read encrypted data .
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) {
		mtx_lock(&sc->sc_queue_mtx);
		if (sc->sc_flags & G_ELI_FLAG_SUSPEND) {
			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.");
	g_io_request(cbp, cp);
}
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 ) { mtx_lock ( & sc -> sc_queue_mtx ) ; if ( sc -> sc_flags & G_ELI_FLAG_SUSPEND ) { G_ELI_DEBUG ( 0 , " " ) ; 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 , " " ) ; g_io_request ( cbp , cp ) ; }
The function is called to read encrypted data.
The function is called to read encrypted data .
/*
		 * We are not called from the worker thread, so check if
		 * device is suspended.
		 */ /*
			 * If device is suspended, we place the request onto
			 * the queue, so it can be handled after resume.
			 */ /*
	 * Read encrypted data from provider.
	 */