Lines Matching refs:bp
65 g_eli_bio_copyin(struct bio *bp, void *kaddr) in g_eli_bio_copyin() argument
71 iov[0].iov_len = bp->bio_length; in g_eli_bio_copyin()
75 uio.uio_resid = bp->bio_length; in g_eli_bio_copyin()
78 uiomove_fromphys(bp->bio_ma, bp->bio_ma_offset, bp->bio_length, &uio); in g_eli_bio_copyin()
90 struct bio *bp; in g_eli_crypto_read_done() local
96 bp = (struct bio *)crp->crp_opaque; in g_eli_crypto_read_done()
97 bp->bio_inbed++; in g_eli_crypto_read_done()
100 bp->bio_inbed, bp->bio_children); in g_eli_crypto_read_done()
101 bp->bio_completed += crp->crp_payload_length; in g_eli_crypto_read_done()
104 bp->bio_inbed, bp->bio_children, crp->crp_etype); in g_eli_crypto_read_done()
105 if (bp->bio_error == 0) in g_eli_crypto_read_done()
106 bp->bio_error = crp->crp_etype; in g_eli_crypto_read_done()
108 sc = bp->bio_to->geom->softc; in g_eli_crypto_read_done()
115 if (bp->bio_inbed < bp->bio_children) in g_eli_crypto_read_done()
118 if (bp->bio_error != 0) { in g_eli_crypto_read_done()
119 G_ELI_LOGREQ(0, bp, "Crypto READ request failed (error=%d).", in g_eli_crypto_read_done()
120 bp->bio_error); in g_eli_crypto_read_done()
121 bp->bio_completed = 0; in g_eli_crypto_read_done()
126 g_io_deliver(bp, bp->bio_error); in g_eli_crypto_read_done()
143 struct bio *bp, *cbp; in g_eli_crypto_write_done() local
149 bp = (struct bio *)crp->crp_opaque; in g_eli_crypto_write_done()
150 bp->bio_inbed++; in g_eli_crypto_write_done()
153 bp->bio_inbed, bp->bio_children); in g_eli_crypto_write_done()
156 bp->bio_inbed, bp->bio_children, crp->crp_etype); in g_eli_crypto_write_done()
157 if (bp->bio_error == 0) in g_eli_crypto_write_done()
158 bp->bio_error = crp->crp_etype; in g_eli_crypto_write_done()
160 gp = bp->bio_to->geom; in g_eli_crypto_write_done()
168 if (bp->bio_inbed < bp->bio_children) in g_eli_crypto_write_done()
170 bp->bio_inbed = 0; in g_eli_crypto_write_done()
171 bp->bio_children = 1; in g_eli_crypto_write_done()
172 cbp = bp->bio_driver1; in g_eli_crypto_write_done()
173 bp->bio_driver1 = NULL; in g_eli_crypto_write_done()
174 if (bp->bio_error != 0) { in g_eli_crypto_write_done()
175 G_ELI_LOGREQ(0, bp, "Crypto WRITE request failed (error=%d).", in g_eli_crypto_write_done()
176 bp->bio_error); in g_eli_crypto_write_done()
177 g_eli_free_data(bp); in g_eli_crypto_write_done()
179 g_io_deliver(bp, bp->bio_error); in g_eli_crypto_write_done()
183 cbp->bio_data = bp->bio_driver2; in g_eli_crypto_write_done()
206 g_eli_crypto_read(struct g_eli_softc *sc, struct bio *bp, boolean_t fromworker) in g_eli_crypto_read() argument
223 bioq_insert_tail(&sc->sc_queue, bp); in g_eli_crypto_read()
231 G_ELI_SETWORKER(bp->bio_pflags, 0); in g_eli_crypto_read()
232 bp->bio_driver2 = NULL; in g_eli_crypto_read()
233 cbp = bp->bio_driver1; in g_eli_crypto_read()
254 g_eli_crypto_run(struct g_eli_worker *wr, struct bio *bp) in g_eli_crypto_run() argument
266 G_ELI_LOGREQ(3, bp, "%s", __func__); in g_eli_crypto_run()
268 G_ELI_SETWORKER(bp->bio_pflags, wr->w_number); in g_eli_crypto_run()
271 nsec = bp->bio_length / secsize; in g_eli_crypto_run()
273 bp->bio_inbed = 0; in g_eli_crypto_run()
274 bp->bio_children = nsec; in g_eli_crypto_run()
280 if (bp->bio_cmd == BIO_WRITE) { in g_eli_crypto_run()
281 if (!g_eli_alloc_data(bp, bp->bio_length)) { in g_eli_crypto_run()
282 G_ELI_LOGREQ(0, bp, "Crypto request failed (ENOMEM)."); in g_eli_crypto_run()
283 if (bp->bio_driver1 != NULL) { in g_eli_crypto_run()
284 g_destroy_bio(bp->bio_driver1); in g_eli_crypto_run()
285 bp->bio_driver1 = NULL; in g_eli_crypto_run()
287 bp->bio_error = ENOMEM; in g_eli_crypto_run()
288 g_io_deliver(bp, bp->bio_error); in g_eli_crypto_run()
293 data = bp->bio_driver2; in g_eli_crypto_run()
298 if ((bp->bio_flags & BIO_UNMAPPED) != 0) in g_eli_crypto_run()
299 g_eli_bio_copyin(bp, data); in g_eli_crypto_run()
301 bcopy(bp->bio_data, data, bp->bio_length); in g_eli_crypto_run()
303 if ((bp->bio_flags & BIO_UNMAPPED) != 0) { in g_eli_crypto_run()
304 pages = bp->bio_ma; in g_eli_crypto_run()
305 pages_offset = bp->bio_ma_offset; in g_eli_crypto_run()
307 data = bp->bio_data; in g_eli_crypto_run()
314 for (i = 0, dstoff = bp->bio_offset; i < nsec; i++, dstoff += secsize) { in g_eli_crypto_run()
327 crp->crp_opaque = (void *)bp; in g_eli_crypto_run()
328 if (bp->bio_cmd == BIO_WRITE) { in g_eli_crypto_run()