Lines Matching defs:bp

132 	struct bio *bp;
138 bp = (struct bio *)crp->crp_opaque;
139 bp->bio_inbed++;
141 bp->bio_completed += crp->crp_olen;
143 bp->bio_inbed, bp->bio_children, (intmax_t)crp->crp_olen, (intmax_t)bp->bio_completed);
146 bp->bio_inbed, bp->bio_children, crp->crp_etype);
147 if (bp->bio_error == 0)
148 bp->bio_error = crp->crp_etype;
150 sc = bp->bio_to->geom->softc;
155 if (bp->bio_inbed < bp->bio_children)
157 if (bp->bio_error == 0) {
166 decr_secsize = bp->bio_to->sectorsize;
172 nsec = bp->bio_length / decr_secsize;
178 srcdata = bp->bio_driver2;
179 dstdata = bp->bio_data;
194 if (bp->bio_error == 0)
195 bp->bio_error = -1;
197 coroff = bp->bio_offset +
198 (dstdata - (u_char *)bp->bio_data);
228 free(bp->bio_driver2, M_ELI);
229 bp->bio_driver2 = NULL;
230 if (bp->bio_error != 0) {
231 if (bp->bio_error == -1)
232 bp->bio_error = EINVAL;
234 G_ELI_LOGREQ(0, bp,
236 bp->bio_error);
238 bp->bio_completed = 0;
243 g_io_deliver(bp, bp->bio_error);
258 struct bio *bp, *cbp, *cbp2;
265 bp = (struct bio *)crp->crp_opaque;
266 bp->bio_inbed++;
269 bp->bio_inbed, bp->bio_children);
272 bp->bio_inbed, bp->bio_children, crp->crp_etype);
273 if (bp->bio_error == 0)
274 bp->bio_error = crp->crp_etype;
276 sc = bp->bio_to->geom->softc;
281 if (bp->bio_inbed < bp->bio_children)
283 if (bp->bio_error != 0) {
284 G_ELI_LOGREQ(0, bp, "Crypto WRITE request failed (error=%d).",
285 bp->bio_error);
286 free(bp->bio_driver2, M_ELI);
287 bp->bio_driver2 = NULL;
288 cbp = bp->bio_driver1;
289 bp->bio_driver1 = NULL;
291 g_io_deliver(bp, bp->bio_error);
296 cbp = bp->bio_driver1;
297 bp->bio_driver1 = NULL;
302 nsec = bp->bio_length / bp->bio_to->sectorsize;
307 cbp->bio_offset = (bp->bio_offset / bp->bio_to->sectorsize) * sc->sc_bytes_per_sector;
308 cbp->bio_data = bp->bio_driver2;
316 cbp2 = g_duplicate_bio(bp);
328 bp->bio_inbed = 0;
329 bp->bio_children = (cbp2 != NULL ? 2 : 1);
339 g_eli_auth_read(struct g_eli_softc *sc, struct bio *bp)
346 bp->bio_pflags = 0;
349 cbp = bp->bio_driver1;
350 bp->bio_driver1 = NULL;
355 nsec = bp->bio_length / bp->bio_to->sectorsize;
365 cbp->bio_offset = (bp->bio_offset / bp->bio_to->sectorsize) * sc->sc_bytes_per_sector;
366 bp->bio_driver2 = malloc(size, M_ELI, M_WAITOK);
367 cbp->bio_data = bp->bio_driver2;
375 cbp2 = g_duplicate_bio(bp);
404 g_eli_auth_run(struct g_eli_worker *wr, struct bio *bp)
414 G_ELI_LOGREQ(3, bp, "%s", __func__);
416 bp->bio_pflags = wr->w_number;
419 decr_secsize = bp->bio_to->sectorsize;
425 nsec = bp->bio_length / decr_secsize;
431 dstoff = (bp->bio_offset / bp->bio_to->sectorsize) * sc->sc_bytes_per_sector;
434 plaindata = bp->bio_data;
435 if (bp->bio_cmd == BIO_READ) {
436 data = bp->bio_driver2;
449 bp->bio_driver2 = data;
452 bp->bio_inbed = 0;
453 bp->bio_children = nsec;
472 if (bp->bio_cmd == BIO_WRITE)
477 if (bp->bio_cmd == BIO_READ) {
491 crp->crp_opaque = (void *)bp;
497 if (bp->bio_cmd == BIO_WRITE) {
514 if (bp->bio_cmd == BIO_WRITE)