* The Regents of the University of California. All rights reserved.
* %sccs.include.redist.c%
* @(#)disklabel.c 8.1 (Berkeley) %G%
#include <sys/disklabel.h>
struct disklabel
*dlp
, *elp
;
elp
= (struct disklabel
*)(buf
+ DEV_BSIZE
- sizeof(*dlp
));
for (dlp
= (struct disklabel
*)buf
; dlp
<= elp
;
dlp
= (struct disklabel
*)((char *)dlp
+ sizeof(long))) {
if (dlp
->d_magic
!= DISKMAGIC
|| dlp
->d_magic2
!= DISKMAGIC
) {
} else if (dlp
->d_npartitions
> MAXPARTITIONS
||
msg
= "disk label corrupted";
* Compute checksum for disk label.
register struct disklabel
*lp
;
register u_short
*start
, *end
;
register u_short sum
= 0;
end
= (u_short
*)&lp
->d_partitions
[lp
->d_npartitions
];