diff options
author | 2015-12-24 18:03:02 +0000 | |
---|---|---|
committer | 2015-12-24 18:03:02 +0000 | |
commit | 12b4e8282ec1d824e20a7e601e5f34b8cbdf239b (patch) | |
tree | ec943435f0c23cf2c695ccdd3137b1946ef69c87 /sys/kern/subr_disk.c | |
parent | bzero -> memset. No binary change. (diff) | |
download | wireguard-openbsd-12b4e8282ec1d824e20a7e601e5f34b8cbdf239b.tar.xz wireguard-openbsd-12b4e8282ec1d824e20a7e601e5f34b8cbdf239b.zip |
Make all instances of gpt_chk_mbr() identical (bar static vs
non-static) by passing disk size as 2nd parameter instead of the
different structures holding the disk size info. The fifth copy of
gpt_chk_mbr() in fdisk is a little specialer. No functional change.
Diffstat (limited to 'sys/kern/subr_disk.c')
-rw-r--r-- | sys/kern/subr_disk.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index 2702b0ce248..38babce4e30 100644 --- a/sys/kern/subr_disk.c +++ b/sys/kern/subr_disk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_disk.c,v 1.220 2015/09/25 11:56:21 krw Exp $ */ +/* $OpenBSD: subr_disk.c,v 1.221 2015/12/24 18:03:03 krw Exp $ */ /* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */ /* @@ -104,7 +104,7 @@ void disk_attach_callback(void *); int spoofgptlabel(struct buf *, void (*)(struct buf *), struct disklabel *); -int gpt_chk_mbr(struct dos_partition *, struct disklabel *); +int gpt_chk_mbr(struct dos_partition *, u_int64_t); int gpt_chk_hdr(struct gpt_header *, struct disklabel *); int gpt_chk_parts(struct gpt_header *, struct gpt_partition *); int gpt_get_fstype(struct uuid *); @@ -371,7 +371,7 @@ readdoslabel(struct buf *bp, void (*strat)(struct buf *), if (mbrtest != 0x55aa) goto notmbr; - if (gpt_chk_mbr(dp, lp) != 0) + if (gpt_chk_mbr(dp, DL_GETDSIZE(lp)) != 0) goto notgpt; gptlp = malloc(sizeof(struct disklabel), M_DEVBUF, @@ -592,10 +592,9 @@ notfat: * NOTE: MS always uses a size of UINT32_MAX for the EFI partition!** */ int -gpt_chk_mbr(struct dos_partition *dp, struct disklabel *lp) +gpt_chk_mbr(struct dos_partition *dp, u_int64_t dsize) { struct dos_partition *dp2; - u_int64_t dsize; int efi, found, i; u_int32_t psize; @@ -606,7 +605,6 @@ gpt_chk_mbr(struct dos_partition *dp, struct disklabel *lp) found++; if (dp2->dp_typ != DOSPTYP_EFI) continue; - dsize = DL_GETDSIZE(lp); psize = letoh32(dp2->dp_size); if (psize == (dsize - 1) || psize == UINT32_MAX) { |