From 2cfeccc54f0e1acff3bd1556010354c71b19a8c3 Mon Sep 17 00:00:00 2001 From: marco Date: Tue, 29 Jan 2008 23:25:02 +0000 Subject: Improve performance dramatically by preventing severeal context switches. Decrypt only once on entry or exit instead of on in and out regardless of direction. There is still room for improvement but this is the first stab. Tested by many ok tedu --- sys/dev/softraid.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/dev/softraid.c') diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index b03137755e2..408516f511e 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.96 2008/01/24 19:58:08 marco Exp $ */ +/* $OpenBSD: softraid.c,v 1.97 2008/01/29 23:25:02 marco Exp $ */ /* * Copyright (c) 2007 Marco Peereboom * @@ -277,6 +277,7 @@ sr_put_ccb(struct sr_ccb *ccb) ccb->ccb_wu = NULL; ccb->ccb_state = SR_CCB_FREE; ccb->ccb_target = -1; + ccb->ccb_opaque = NULL; TAILQ_INSERT_TAIL(&sd->sd_ccb_freeq, ccb, ccb_link); @@ -807,7 +808,7 @@ sr_ioctl_createraid(struct sr_softc *sc, struct bioc_createraid *bc, int user) break; #if 0 case 'C': - if (no_chunk != 1) + if (no_chunk < 2) goto unwind; strlcpy(sd->sd_name, "CRYPTO", sizeof(sd->sd_name)); vol_size = ch_entry->src_meta.scm_coerced_size; -- cgit v1.2.3-59-g8ed1b