summaryrefslogtreecommitdiff
path: root/sys/dev/softraid_crypto.c
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2011-04-06 03:14:52 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2011-04-06 03:14:52 +0000
commiteb4b46d439e370c3d9db4d5dba7815b11a875356 (patch)
tree041eb97598b2ec68fadafe7779fea9227e1db679 /sys/dev/softraid_crypto.c
parent84696ae703a237081083601f766a00cc9f3244ed (diff)
make crypto work with bigmem
Diffstat (limited to 'sys/dev/softraid_crypto.c')
-rw-r--r--sys/dev/softraid_crypto.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/softraid_crypto.c b/sys/dev/softraid_crypto.c
index 93326d435f0..f24f3d11cbe 100644
--- a/sys/dev/softraid_crypto.c
+++ b/sys/dev/softraid_crypto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_crypto.c,v 1.64 2011/04/05 19:52:02 krw Exp $ */
+/* $OpenBSD: softraid_crypto.c,v 1.65 2011/04/06 03:14:51 marco Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Hans-Joerg Hoexer <hshoexer@openbsd.org>
@@ -258,8 +258,7 @@ sr_crypto_getcryptop(struct sr_workunit *wu, int encrypt)
uio->uio_iovcnt = 1;
uio->uio_iov->iov_len = xs->datalen;
if (xs->flags & SCSI_DATA_OUT) {
- uio->uio_iov->iov_base = malloc(xs->datalen, M_DEVBUF,
- M_NOWAIT);
+ uio->uio_iov->iov_base = dma_alloc(xs->datalen, PR_NOWAIT);
if (uio->uio_iov->iov_base == NULL)
goto unwind;
bcopy(xs->data, uio->uio_iov->iov_base, xs->datalen);
@@ -322,7 +321,7 @@ unwind:
if (uio && uio->uio_iov)
if ((wu->swu_xs->flags & SCSI_DATA_OUT) &&
uio->uio_iov->iov_base)
- free(uio->uio_iov->iov_base, M_DEVBUF);
+ dma_free(uio->uio_iov->iov_base, uio->uio_iov->iov_len);
s = splbio();
if (uio && uio->uio_iov)
@@ -346,7 +345,7 @@ sr_crypto_putcryptop(struct cryptop *crp)
DEVNAME(wu->swu_dis->sd_sc), crp);
if ((wu->swu_xs->flags & SCSI_DATA_OUT) && uio->uio_iov->iov_base)
- free(uio->uio_iov->iov_base, M_DEVBUF);
+ dma_free(uio->uio_iov->iov_base, uio->uio_iov->iov_len);
s = splbio();
pool_put(&sd->mds.mdd_crypto.sr_iovpl, uio->uio_iov);
pool_put(&sd->mds.mdd_crypto.sr_uiopl, uio);