aboutsummaryrefslogtreecommitdiff
path: root/stand/usb
diff options
context:
space:
mode:
authorIan Lepore <ian@FreeBSD.org>2019-03-24 18:51:52 +0000
committerIan Lepore <ian@FreeBSD.org>2019-03-24 18:51:52 +0000
commit14243f8de746e756ad3466aa6920a80e39157d9c (patch)
tree3936c489d95157660582dd99004d341945278634 /stand/usb
parent6d51c0fe72565473d709b19e12229517804d521e (diff)
downloadsrc-14243f8de746e756ad3466aa6920a80e39157d9c.tar.gz
src-14243f8de746e756ad3466aa6920a80e39157d9c.zip
Distinguish between "no partition" and "choose best partition" with a constant.
The values of the d_slice and d_partition fields of a disk_devdesc have a few values with special meanings in the disk_open() routine. Through various evolutions of the loader code over time, a d_partition value of -1 has meant both "use the first ufs partition found in the bsd label" and "don't open a bsd partition at all, open the raw slice." This defines a new special value of -2 to mean open the raw slice, and it gives symbolic names to all the special values used in d_slice and d_partition, and adjusts all existing uses of those fields to use the new constants. The phab review for this timed out without being accepted, but I'm still citing it below because there is useful commentary there. Differential Revision: https://reviews.freebsd.org/D19262
Notes
Notes: svn path=/head/; revision=345477
Diffstat (limited to 'stand/usb')
-rw-r--r--stand/usb/storage/umass_loader.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/stand/usb/storage/umass_loader.c b/stand/usb/storage/umass_loader.c
index fbb890be279a..1c12f05c2769 100644
--- a/stand/usb/storage/umass_loader.c
+++ b/stand/usb/storage/umass_loader.c
@@ -196,8 +196,8 @@ umass_disk_print(int verbose)
return (ret);
dev.d_dev = &umass_disk;
dev.d_unit = 0;
- dev.d_slice = -1;
- dev.d_partition = -1;
+ dev.d_slice = D_SLICENONE;
+ dev.d_partition = D_PARTNONE;
if (umass_disk_open_sub(&dev) == 0) {
ret = disk_print(&dev, " umass0", verbose);