Lines Matching refs:bp

71 	struct bio *bp;
77 bp = (struct bio *)crp->crp_opaque;
78 bp->bio_inbed++;
81 bp->bio_inbed, bp->bio_children);
82 bp->bio_completed += crp->crp_olen;
85 bp->bio_inbed, bp->bio_children, crp->crp_etype);
86 if (bp->bio_error == 0)
87 bp->bio_error = crp->crp_etype;
89 sc = bp->bio_to->geom->softc;
94 if (bp->bio_inbed < bp->bio_children)
96 free(bp->bio_driver2, M_ELI);
97 bp->bio_driver2 = NULL;
98 if (bp->bio_error != 0) {
99 G_ELI_LOGREQ(0, bp, "Crypto READ request failed (error=%d).",
100 bp->bio_error);
101 bp->bio_completed = 0;
106 g_io_deliver(bp, bp->bio_error);
122 struct bio *bp, *cbp;
128 bp = (struct bio *)crp->crp_opaque;
129 bp->bio_inbed++;
132 bp->bio_inbed, bp->bio_children);
135 bp->bio_inbed, bp->bio_children, crp->crp_etype);
136 if (bp->bio_error == 0)
137 bp->bio_error = crp->crp_etype;
139 gp = bp->bio_to->geom;
145 if (bp->bio_inbed < bp->bio_children)
147 bp->bio_inbed = 0;
148 bp->bio_children = 1;
149 cbp = bp->bio_driver1;
150 bp->bio_driver1 = NULL;
151 if (bp->bio_error != 0) {
152 G_ELI_LOGREQ(0, bp, "Crypto WRITE request failed (error=%d).",
153 bp->bio_error);
154 free(bp->bio_driver2, M_ELI);
155 bp->bio_driver2 = NULL;
157 g_io_deliver(bp, bp->bio_error);
161 cbp->bio_data = bp->bio_driver2;
179 g_eli_crypto_read(struct g_eli_softc *sc, struct bio *bp, boolean_t fromworker)
196 bioq_insert_tail(&sc->sc_queue, bp);
204 bp->bio_pflags = 0;
205 bp->bio_driver2 = NULL;
206 cbp = bp->bio_driver1;
227 g_eli_crypto_run(struct g_eli_worker *wr, struct bio *bp)
238 G_ELI_LOGREQ(3, bp, "%s", __func__);
240 bp->bio_pflags = wr->w_number;
243 nsec = bp->bio_length / secsize;
258 if (bp->bio_cmd == BIO_WRITE)
259 size += bp->bio_length;
262 bp->bio_inbed = 0;
263 bp->bio_children = nsec;
264 bp->bio_driver2 = p;
266 if (bp->bio_cmd == BIO_READ)
267 data = bp->bio_data;
270 p += bp->bio_length;
271 bcopy(bp->bio_data, data, bp->bio_length);
274 for (i = 0, dstoff = bp->bio_offset; i < nsec; i++, dstoff += secsize) {
281 crp->crp_opaque = (void *)bp;
284 if (bp->bio_cmd == BIO_WRITE)
286 else /* if (bp->bio_cmd == BIO_READ) */
298 if (bp->bio_cmd == BIO_WRITE)