From 4ab23710cdd747c81b3f3a7ed37e7d39167ada08 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Thu, 1 Oct 2015 20:28:13 +0000 Subject: Use DOS_LABELSECTOR rather than LABELSECTOR to indicate offset into an OpenBSD partition when accessing the disklabel. For these files both are '1', but this makes the usage consistent across all archs. ok guenther@ miod@ --- sys/arch/i386/stand/libsa/biosdev.c | 7 +++---- sys/arch/i386/stand/libsa/softraid.c | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'sys/arch/i386/stand/libsa') diff --git a/sys/arch/i386/stand/libsa/biosdev.c b/sys/arch/i386/stand/libsa/biosdev.c index 8725de1f005..19cfa3b77a7 100644 --- a/sys/arch/i386/stand/libsa/biosdev.c +++ b/sys/arch/i386/stand/libsa/biosdev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: biosdev.c,v 1.91 2015/09/19 21:07:04 semarie Exp $ */ +/* $OpenBSD: biosdev.c,v 1.92 2015/10/01 20:28:12 krw Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -442,15 +442,14 @@ bios_getdisklabel(bios_diskinfo_t *bd, struct disklabel *label) return "no OpenBSD partition\n"; } } - start = LABELSECTOR + start; /* Load BSD disklabel */ #ifdef BIOS_DEBUG if (debug) - printf("loading disklabel @ %u\n", start); + printf("loading disklabel @ %u\n", start + DOS_LABELSECTOR); #endif /* read disklabel */ - error = biosd_io(F_READ, bd, start, 1, buf); + error = biosd_io(F_READ, bd, start + DOS_LABELSECTOR, 1, buf); if (error) return "failed to read disklabel"; diff --git a/sys/arch/i386/stand/libsa/softraid.c b/sys/arch/i386/stand/libsa/softraid.c index 2f45421f6fb..bf46d86b85e 100644 --- a/sys/arch/i386/stand/libsa/softraid.c +++ b/sys/arch/i386/stand/libsa/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.12 2015/09/02 04:09:24 yasuoka Exp $ */ +/* $OpenBSD: softraid.c,v 1.13 2015/10/01 20:28:12 krw Exp $ */ /* * Copyright (c) 2012 Joel Sing @@ -421,10 +421,9 @@ sr_getdisklabel(struct sr_boot_volume *bv, struct disklabel *label) } } - start += LABELSECTOR; - /* Read the disklabel. */ - sr_strategy(bv, F_READ, start, sizeof(struct disklabel), buf, NULL); + sr_strategy(bv, F_READ, start + DOS_LABELSECTOR, + sizeof(struct disklabel), buf, NULL); #ifdef BIOS_DEBUG printf("sr_getdisklabel: magic %lx\n", -- cgit v1.2.3