summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid.c
diff options
context:
space:
mode:
authormarco <marco@openbsd.org>2011-04-06 02:35:51 +0000
committermarco <marco@openbsd.org>2011-04-06 02:35:51 +0000
commit416d73b9b11f161f66ce7ef5c933880658f904bf (patch)
treeaa26e0dfafa2e433f20eb6b8723ec72e4a2fa0e2 /sys/dev/softraid.c
parenthandle bigmem for metadata reads and writes. this should be pre allocated (diff)
downloadwireguard-openbsd-416d73b9b11f161f66ce7ef5c933880658f904bf.tar.xz
wireguard-openbsd-416d73b9b11f161f66ce7ef5c933880658f904bf.zip
make rebuild also work in bigmem
Diffstat (limited to 'sys/dev/softraid.c')
-rw-r--r--sys/dev/softraid.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index 86bd2f1e038..c219740ee05 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.224 2011/04/06 02:00:10 marco Exp $ */
+/* $OpenBSD: softraid.c,v 1.225 2011/04/06 02:35:51 marco Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -3934,7 +3934,8 @@ sr_rebuild_thread(void *arg)
sd->sd_reb_active = 1;
- buf = malloc(SR_REBUILD_IO_SIZE << DEV_BSHIFT, M_DEVBUF, M_WAITOK);
+ /* currently this is 64k therefore we can use dma_alloc */
+ buf = dma_alloc(SR_REBUILD_IO_SIZE << DEV_BSHIFT, PR_WAITOK);
for (blk = restart; blk <= whole_blk; blk++) {
if (blk == whole_blk)
sz = partial_blk;
@@ -4053,7 +4054,7 @@ abort:
printf("%s: could not save metadata to %s\n",
DEVNAME(sc), sd->sd_meta->ssd_devname);
fail:
- free(buf, M_DEVBUF);
+ dma_free(buf, SR_REBUILD_IO_SIZE << DEV_BSHIFT);
sd->sd_reb_active = 0;
kthread_exit(0);
}