summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid.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.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.c')
-rw-r--r--sys/dev/softraid.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index e0a57d5e918..b83bfc495be 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.195 2010/03/23 01:57:19 krw Exp $ */
+/* $OpenBSD: softraid.c,v 1.196 2010/03/26 11:20:34 jsing Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -1341,8 +1341,7 @@ sr_meta_native_probe(struct sr_softc *sc, struct sr_chunk *ch_entry)
goto unwind;
}
- size = DL_GETPSIZE(&label.d_partitions[part]) -
- SR_META_SIZE - SR_META_OFFSET;
+ size = DL_GETPSIZE(&label.d_partitions[part]) - SR_DATA_OFFSET;
if (size <= 0) {
DNPRINTF(SR_D_META, "%s: %s partition too small\n", DEVNAME(sc),
devname);
@@ -2351,8 +2350,7 @@ sr_hotspare(struct sr_softc *sc, dev_t dev)
}
/* Calculate partition size. */
- size = DL_GETPSIZE(&label.d_partitions[part]) -
- SR_META_SIZE - SR_META_OFFSET;
+ size = DL_GETPSIZE(&label.d_partitions[part]) - SR_DATA_OFFSET;
/*
* Create and populate chunk metadata.
@@ -2646,8 +2644,7 @@ sr_rebuild_init(struct sr_discipline *sd, dev_t dev, int hotspare)
}
/* is partition large enough? */
- size = DL_GETPSIZE(&label.d_partitions[part]) -
- SR_META_SIZE - SR_META_OFFSET;
+ size = DL_GETPSIZE(&label.d_partitions[part]) - SR_DATA_OFFSET;
if (size < csize) {
printf("%s: partition too small, at least %llu B required\n",
DEVNAME(sc), csize << DEV_BSHIFT);