Page MenuHomeFreeBSD

stand: Add dv_devfmt to return a string represenation of the device

Authored by imp on Jul 25 2022, 8:32 PM.
Referenced Files
Unknown Object (File)
Dec 20 2023, 6:33 AM
Unknown Object (File)
Dec 19 2023, 5:03 PM
Unknown Object (File)
Dec 4 2023, 2:01 PM
Unknown Object (File)
Oct 31 2023, 10:46 PM
Unknown Object (File)
Aug 28 2023, 6:21 PM
Unknown Object (File)
Aug 28 2023, 6:20 PM
Unknown Object (File)
Aug 28 2023, 6:20 PM
Unknown Object (File)
Aug 28 2023, 6:19 PM



Add a new pointer, dv_devfmt, to allow devices to format themselves. We
will use this to simplify many of the fmtdev functions in the tree as
they are all almost the same, or all are isomorphic to each other.

Sponsored by: Netflix

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable

Event Timeline

imp requested review of this revision.Jul 25 2022, 8:32 PM

Is there more background for this specific size? I mean, we have DEV_NAMLEN + 10 chars in int + colon + NUL... asking because 128 bytes add up in text+data+bss of BIOS loader:)


128 was used in a lot of places (see subsequent reviews) so I used that here.
For disk devices, I don't see this ever being > diskXXXXsXXa: (so up to 10k disks, 100 partitions and maybe a bsd label for evilness).
I'm not sure what a good limit is here, but in most loaders, this will just be 128 bytes once in the devformat static buffer.

This revision is now accepted and ready to land.Jul 26 2022, 10:30 AM
This revision now requires review to proceed.Jul 28 2022, 4:57 PM
This revision was not accepted when it landed; it landed in state Needs Review.Aug 11 2022, 4:28 PM
This revision was automatically updated to reflect the committed changes.