Lines 270-277
g_shsec_done(struct bio *bp)
Link Here
|
270 |
(ssize_t)pbp->bio_length); |
270 |
(ssize_t)pbp->bio_length); |
271 |
} |
271 |
} |
272 |
} |
272 |
} |
273 |
explicit_bzero(bp->bio_data, bp->bio_length); |
273 |
if (bp->bio_data != NULL) { |
274 |
uma_zfree(g_shsec_zone, bp->bio_data); |
274 |
explicit_bzero(bp->bio_data, bp->bio_length); |
|
|
275 |
uma_zfree(g_shsec_zone, bp->bio_data); |
276 |
} |
275 |
g_destroy_bio(bp); |
277 |
g_destroy_bio(bp); |
276 |
pbp->bio_inbed++; |
278 |
pbp->bio_inbed++; |
277 |
if (pbp->bio_children == pbp->bio_inbed) { |
279 |
if (pbp->bio_children == pbp->bio_inbed) { |
Lines 349-370
g_shsec_start(struct bio *bp)
Link Here
|
349 |
* Fill in the component buf structure. |
351 |
* Fill in the component buf structure. |
350 |
*/ |
352 |
*/ |
351 |
cbp->bio_done = g_shsec_done; |
353 |
cbp->bio_done = g_shsec_done; |
352 |
cbp->bio_data = uma_zalloc(g_shsec_zone, M_NOWAIT); |
354 |
if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { |
353 |
if (cbp->bio_data == NULL) { |
355 |
cbp->bio_data = uma_zalloc(g_shsec_zone, M_NOWAIT); |
354 |
g_shsec_alloc_failed++; |
356 |
if (cbp->bio_data == NULL) { |
355 |
error = ENOMEM; |
357 |
g_shsec_alloc_failed++; |
356 |
goto failure; |
358 |
error = ENOMEM; |
357 |
} |
359 |
goto failure; |
358 |
cbp->bio_caller2 = sc->sc_disks[no]; |
360 |
} |
359 |
if (bp->bio_cmd == BIO_WRITE) { |
361 |
if (bp->bio_cmd == BIO_WRITE) { |
360 |
if (no == 0) { |
362 |
if (no == 0) { |
361 |
dst = (uint32_t *)cbp->bio_data; |
363 |
dst = (uint32_t *)cbp->bio_data; |
362 |
bcopy(bp->bio_data, dst, len); |
364 |
bcopy(bp->bio_data, dst, len); |
363 |
} else { |
365 |
} else { |
364 |
g_shsec_xor2((uint32_t *)cbp->bio_data, dst, |
366 |
g_shsec_xor2((uint32_t *)cbp->bio_data, |
365 |
len); |
367 |
dst, len); |
|
|
368 |
} |
366 |
} |
369 |
} |
367 |
} |
370 |
} |
|
|
371 |
cbp->bio_caller2 = sc->sc_disks[no]; |
368 |
} |
372 |
} |
369 |
/* |
373 |
/* |
370 |
* Fire off all allocated requests! |
374 |
* Fire off all allocated requests! |