summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid_raid0.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2010-03-26 11:20:34 +0000
committerjsing <jsing@openbsd.org>2010-03-26 11:20:34 +0000
commitf6e5141f756d7432a6514212017fd86d5d02ed1f (patch)
treee8263bdccbeae1abdea519776e474a7db1f51f88 /sys/dev/softraid_raid0.c
parenttweak previous; (diff)
downloadwireguard-openbsd-f6e5141f756d7432a6514212017fd86d5d02ed1f.tar.xz
wireguard-openbsd-f6e5141f756d7432a6514212017fd86d5d02ed1f.zip
Add storage for the boot block and boot loader to the softraid metadata.
Also add a new optional metadata type for boot data. This is the first step (of many) towards being able to boot from softraid volumes. WARNING: This version of the softraid metadata is not compatible with previous versions. As a result, any softraid volumes created with older kernels will not assemble. Data on existing softraid volumes should be backed up before upgrading. The volume should then be recreated and the data restored. ok marco@
Diffstat (limited to 'sys/dev/softraid_raid0.c')
-rw-r--r--sys/dev/softraid_raid0.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/softraid_raid0.c b/sys/dev/softraid_raid0.c
index 9fe048f3b63..c0c7e9d218b 100644
--- a/sys/dev/softraid_raid0.c
+++ b/sys/dev/softraid_raid0.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raid0.c,v 1.19 2010/01/09 23:15:06 krw Exp $ */
+/* $OpenBSD: softraid_raid0.c,v 1.20 2010/03/26 11:20:34 jsing Exp $ */
/*
* Copyright (c) 2008 Marco Peereboom <marco@peereboom.us>
*
@@ -300,8 +300,7 @@ sr_raid0_rw(struct sr_workunit *wu)
chunk = strip_no % no_chunk;
stripoffs = lbaoffs & (strip_size - 1);
chunkoffs = (strip_no / no_chunk) << strip_bits;
- physoffs = chunkoffs + stripoffs +
- ((SR_META_OFFSET + SR_META_SIZE) << DEV_BSHIFT);
+ physoffs = chunkoffs + stripoffs + (SR_DATA_OFFSET << DEV_BSHIFT);
length = MIN(xs->datalen, strip_size - stripoffs);
leftover = xs->datalen;
data = xs->data;