loader: disk/part api needs to use uint64_t offsets
authortsoome <tsoome@FreeBSD.org>
Wed, 1 Feb 2017 20:10:56 +0000 (20:10 +0000)
committertsoome <tsoome@FreeBSD.org>
Wed, 1 Feb 2017 20:10:56 +0000 (20:10 +0000)
commite6945f7ee62c48a1a3f528c18a59f75f56da08c6
treeb0cd0738984faa2be3194c1f6dde23b5e842d653
parent5354226f974d09c3e1c1cade235cd3ec44f90b77
loader: disk/part api needs to use uint64_t offsets

The disk_* and part_* api is using 64bit values for media size and
offsets. However, the current api is using off_t type, which is signed
64-bit int.

In this context the signed media size does not make any sense, and
the offsets are used to mark absolute, not relative locations.

Also, the data from GPT partition table and some other sources is
already using uint64_t data type, so using signed off_t can cause sign
issues.

Reviewed by: imp
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D8710
sys/boot/common/disk.c
sys/boot/common/disk.h
sys/boot/common/part.c
sys/boot/common/part.h
sys/boot/i386/libi386/biosdisk.c
sys/boot/uboot/lib/disk.c
sys/boot/usb/storage/umass_loader.c
sys/boot/zfs/zfs.c