From e83b776d913d8ba599aa39549c620fb533c8de53 Mon Sep 17 00:00:00 2001 From: Niklas Hallqvist Date: Fri, 8 Aug 1997 21:47:07 +0000 Subject: Change the bounds_check_with_label API to also take a cpu_disklabel reference for making transferral of meta-information possible from readdisklabel to bounds_check_with_label. The first (and maybe only) thing that will use this is the multi-disklabel-format code on the alpha where the labelsector is passed via cpu_disklabel so the label write-protection can work correctly no matter what label was found. Also use a new macro DKBAD to get at the dkbad field of the cpu_disklabel implementations that contain it. This too is for multi-disklabel architectures where the "bad" field can be inside a union. Use this macro as a means for a driver to check if an architecture supports dkbad constructs. Remove proto of bounds_check_with_label from all MD disklabel.h as it is in sys/disklabel.h. I have not been able to test the changes everywhere, if I break anything I apologize, and promise to fix it as soon as I become aware of it. --- sys/arch/arc/include/disklabel.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'sys/arch/arc/include') diff --git a/sys/arch/arc/include/disklabel.h b/sys/arch/arc/include/disklabel.h index 4e8c7c14161..5e46f7005b9 100644 --- a/sys/arch/arc/include/disklabel.h +++ b/sys/arch/arc/include/disklabel.h @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.h,v 1.6 1997/04/10 13:06:25 deraadt Exp $ */ +/* $OpenBSD: disklabel.h,v 1.7 1997/08/08 21:46:37 niklas Exp $ */ /* $NetBSD: disklabel.h,v 1.3 1996/03/09 20:52:54 ghudson Exp $ */ /* @@ -76,13 +76,10 @@ struct cpu_disklabel { struct dkbad bad; }; +#define DKBAD(x) ((x)->bad) + /* Isolate the relevant bits to get sector and cylinder. */ #define DPSECT(s) ((s) & 0x3f) #define DPCYL(c, s) ((c) + (((s) & 0xc0) << 2)) -#ifdef _KERNEL -struct disklabel; -int bounds_check_with_label __P((struct buf *, struct disklabel *, int)); -#endif - #endif /* _MACHINE_DISKLABEL_H_ */ -- cgit v1.2.3