summaryrefslogtreecommitdiffstats
path: root/sys/sys/disklabel.h
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-05-02 22:46:13 +0000
committerphk <phk@FreeBSD.org>2003-05-02 22:46:13 +0000
commit2a47b08091621c84d2d45229dcdb6753d5a56366 (patch)
tree167b9bb293bf61d98bdeb7e2f55bda158e7dc864 /sys/sys/disklabel.h
parent6c2bb0c0915b99851b219ab760eecfc5067d2afc (diff)
downloadFreeBSD-src-2a47b08091621c84d2d45229dcdb6753d5a56366.zip
FreeBSD-src-2a47b08091621c84d2d45229dcdb6753d5a56366.tar.gz
Make bsd_disklabel_le_enc calculate the checksum and fill it in.
(If there is a legitimate need to correctly encode and pack a disklabel with an invalid checksum custom tools can be built for that.) Make bsd_disklabel_le_dec() validate the magics, number of partitions (against a new parameter) and the checksum. Vastly simplify the logic of the GEOM::BSD class implementation: Let g_bsd_modify() always take a byte-stream label. This simplifies all users, except the ioctl's which now have to convert to a byte-stream first. Their loss. g_bsd_modify() is called with topology held now, and it returns with it held. Always update the md5sum in g_bsd_modify(), otherwise the check is no use after the first modification of the label. Make the MD5 over the bytestream version of the label. Move the rawoffset hack to g_bsd_modify() and remove all the inram/ondisk conversions. Don't configure hotspots in g_bsd_modify(), do it in taste instead, we do not support moving the label to a different location on the fly anyway. This passes all current regression tests.
Diffstat (limited to 'sys/sys/disklabel.h')
-rw-r--r--sys/sys/disklabel.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sys/disklabel.h b/sys/sys/disklabel.h
index baf8874..ddcf21a 100644
--- a/sys/sys/disklabel.h
+++ b/sys/sys/disklabel.h
@@ -305,7 +305,7 @@ static const char *fstypenames[] = {
* bytestring.
*/
void bsd_partition_le_dec(u_char *ptr, struct partition *d);
-void bsd_disklabel_le_dec(u_char *ptr, struct disklabel *d);
+int bsd_disklabel_le_dec(u_char *ptr, struct disklabel *d, int maxpart);
void bsd_partition_le_enc(u_char *ptr, struct partition *d);
void bsd_disklabel_le_enc(u_char *ptr, struct disklabel *d);
OpenPOWER on IntegriCloud