Adapt to struct buf changes
This commit is contained in:
parent
b99d8c4997
commit
589d32fb2c
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: disksubr.c,v 1.18 2014/03/31 11:25:49 martin Exp $ */
|
||||
/* $NetBSD: disksubr.c,v 1.19 2014/07/04 08:51:15 martin Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.18 2014/03/31 11:25:49 martin Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.19 2014/07/04 08:51:15 martin Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -57,12 +57,12 @@ mbr_findslice(struct mbr_partition *dp, struct buf *bp)
|
||||
int i;
|
||||
|
||||
/* Note: Magic number is little-endian. */
|
||||
mbrmagicp = (u_int16_t *)(bp->b_data + MBR_MAGIC_OFFSET);
|
||||
mbrmagicp = (u_int16_t *)((char*)bp->b_data + MBR_MAGIC_OFFSET);
|
||||
if (*mbrmagicp != MBR_MAGIC)
|
||||
return (NO_MBR_SIGNATURE);
|
||||
|
||||
/* XXX how do we check veracity/bounds of this? */
|
||||
memcpy(dp, bp->b_data + MBR_PART_OFFSET, MBR_PART_COUNT * sizeof(*dp));
|
||||
memcpy(dp, (char*)bp->b_data + MBR_PART_OFFSET, MBR_PART_COUNT * sizeof(*dp));
|
||||
|
||||
/* look for NetBSD partition */
|
||||
for (i = 0; i < MBR_PART_COUNT; i++) {
|
||||
@ -198,7 +198,7 @@ nombrpart:
|
||||
goto done;
|
||||
}
|
||||
for (dlp = (struct disklabel *)bp->b_data;
|
||||
dlp <= (struct disklabel *)(bp->b_data + lp->d_secsize - sizeof(*dlp));
|
||||
dlp <= (struct disklabel *)((char*)bp->b_data + lp->d_secsize - sizeof(*dlp));
|
||||
dlp = (struct disklabel *)((char *)dlp + sizeof(long))) {
|
||||
if (dlp->d_magic != DISKMAGIC || dlp->d_magic2 != DISKMAGIC) {
|
||||
if (msg == NULL)
|
||||
@ -371,7 +371,7 @@ nombrpart:
|
||||
if ((error = biowait(bp)) != 0)
|
||||
goto done;
|
||||
for (dlp = (struct disklabel *)bp->b_data;
|
||||
dlp <= (struct disklabel *)(bp->b_data + lp->d_secsize - sizeof(*dlp));
|
||||
dlp <= (struct disklabel *)((char*)bp->b_data + lp->d_secsize - sizeof(*dlp));
|
||||
dlp = (struct disklabel *)((char *)dlp + sizeof(long))) {
|
||||
if (dlp->d_magic == DISKMAGIC && dlp->d_magic2 == DISKMAGIC &&
|
||||
dkcksum(dlp) == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user